Skip to content

Instantly share code, notes, and snippets.

@linyows
Forked from cjbottaro/gist:1128091
Created May 31, 2013 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linyows/5683103 to your computer and use it in GitHub Desktop.
Save linyows/5683103 to your computer and use it in GitHub Desktop.
shared_context "for_extending" do
context "extended with MyModule" do
before(:all){ subject.extend(MyModule) }
it "should define #some_method" do
subject.should respond_to(:some_method)
end
yield
end
end
describe Object do
execute_context("for_extending")
end
describe Class do
execute_context("for_extending") do
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