Created
December 6, 2013 18:13
-
-
Save Nitrodist/7829537 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'rspec/core' | |
class TestA | |
def foo | |
true | |
end | |
def bar | |
true | |
end | |
end | |
class TestB | |
def foo | |
false | |
end | |
def bar | |
false | |
end | |
end | |
shared_examples_for 'a special behaviour' do | |
let(:expected_foo) { true } | |
let(:expected_bar) { true } | |
its(:foo) { should eql(expected_foo) } | |
its(:bar) { should eql(expected_bar) } | |
end | |
describe TestA do | |
it_should_behave_like 'a special behaviour' | |
end | |
describe TestB do | |
it_should_behave_like 'a special behaviour' do | |
let(:expected_foo) { false } | |
let(:expected_bar) { false } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment