Skip to content

Instantly share code, notes, and snippets.

@udzura
Forked from cjbottaro/gist:1128108
Created July 23, 2012 02:49
Show Gist options
  • Save udzura/3161776 to your computer and use it in GitHub Desktop.
Save udzura/3161776 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