Created
February 12, 2013 23:06
-
-
Save jbourassa/4774340 to your computer and use it in GitHub Desktop.
Extending is awesome
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
describe NameBilingual do | |
before(:all) do | |
@klass = Class.new do | |
include NameBilingual | |
end | |
end | |
context "Brand new instance" do | |
subject { @klass.new } | |
it { should respond_to :name= } | |
it { should respond_to :name } | |
end | |
context "Custom instance" do | |
subject do | |
instance = @klass.new | |
def instance.new_method | |
# no-op | |
end | |
instance | |
end | |
it { should respond_to :new_method } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment