Sha256: 684b92cb28a9f02b5fd1de1aef08551e24061a192a3b07b476c2e380367cfc81
Contents?: true
Size: 609 Bytes
Versions: 6
Compression:
Stored size: 609 Bytes
Contents
When /^I stub "([^\"]*)" on "([^\"]*)" to "([^\"]*)"$/ do |method_name, const_name, value| const = Object.const_get(const_name) const.stub!(method_name.to_sym).and_return(value) end Then /^calling "([^\"]*)" on "([^\"]*)" should return "([^\"]*)"$/ do |method_name, const_name, value| const = Object.const_get(const_name) const.send(method_name.to_sym).should == value end Then /^"([^\"]*)" should not be defined on "([^\"]*)"$/ do |method_name, const_name| const = Object.const_get(const_name) lambda { const.send(method_name.to_sym) }.should raise_error(NameError, /#{method_name}/) end
Version data entries
6 entries across 6 versions & 3 rubygems