Skip to content

Instantly share code, notes, and snippets.

@dchelimsky
Created December 11, 2011 15:24
Show Gist options
  • Save dchelimsky/1461106 to your computer and use it in GitHub Desktop.
Save dchelimsky/1461106 to your computer and use it in GitHub Desktop.
Interaction between pending and before hooks in RSpec
describe Something do
before(:each) do
do_something_before
end
it "does one thing" do
# before will run for this example because rspec doesn't know it is pending
# until the example is eval'd
pending
end
it "does something else", :pending => true do
# before will _not_ run for this example
end
pending "does yet another thing" do
# before will _not_ run for this example
end
end
@dchelimsky
Copy link
Author

@jbrains - rspec/rspec-core#540 - please feel free to add commentary and/or enable notifications on that issue.

@dchelimsky
Copy link
Author

@zspencer - ha!

@dchelimsky
Copy link
Author

@zspencer, @jbrains - I've got this implemented and will push shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment