Skip to content

Instantly share code, notes, and snippets.

@jbourassa
Created February 12, 2013 23:06
Show Gist options
  • Save jbourassa/4774340 to your computer and use it in GitHub Desktop.
Save jbourassa/4774340 to your computer and use it in GitHub Desktop.
Extending is awesome
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