Skip to content

Instantly share code, notes, and snippets.

@joeljackson
Created October 16, 2014 22:50
Show Gist options
  • Save joeljackson/bae4c70e0b12e3f93a1d to your computer and use it in GitHub Desktop.
Save joeljackson/bae4c70e0b12e3f93a1d to your computer and use it in GitHub Desktop.
describe Something do
before do
allow_any_instance_of(Namespace::MyClass).to receive(:foo)
Something.new.do_something
end
#expect to have received foo
end
class Something
def do_something(class_name)
object = "Namespace::#{class_name}".constantize.new
obejct.foo
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment