Skip to content

Instantly share code, notes, and snippets.

@cjbottaro
Created August 5, 2011 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cjbottaro/1128108 to your computer and use it in GitHub Desktop.
Save cjbottaro/1128108 to your computer and use it in GitHub Desktop.
unDRY rspec code
describe Object do
context "extented with MyModule" do
before(:all){ subject.extend(MyModule) }
it "should define #some_method" do
subject.should respond_to(:some_method)
end
end
end
describe Class do
context "extented with MyModule" do
before(:all){ subject.extend(MyModule) }
it "should define #some_method" do
subject.should respond_to(:some_method)
end
it "should also define #special_method_for_class" do
subject.should respond_to(:special_method_for_class)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment