Forked from eregon/1 rspec_before_exclusion_filter.rb
Created
March 14, 2012 17:29
-
-
Save myronmarston/ca04357f34160fd27d61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec.configure do |config| | |
config.treat_symbols_as_metadata_keys_with_true_values = true | |
config.before(:each, :skip_vcr_reset => lambda { |v| puts; p v; v != true }) do | |
p :before_hook | |
end | |
end | |
describe "Not Skipping" do | |
it 'ex1' do | |
p :ex1 | |
end | |
it 'ex2' do | |
p :ex2 | |
end | |
end | |
describe "Skipping", :skip_vcr_reset do | |
it 'ex3' do | |
p :ex3 | |
end | |
it 'ex4' do | |
p :ex4 | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rspec foo_spec.rb --format doc | |
Not Skipping | |
nil | |
:before_hook | |
:ex1 | |
ex1 | |
nil | |
:before_hook | |
:ex2 | |
ex2 | |
Skipping | |
true | |
true | |
:ex3 | |
ex3 | |
true | |
true | |
:ex4 | |
ex4 | |
Finished in 0.00179 seconds | |
4 examples, 0 failures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment