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

Version Path
rspec-instructure-1.3.3 features/step_definitions/stubbing_steps.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/features/step_definitions/stubbing_steps.rb
rspec-1.3.2 features/step_definitions/stubbing_steps.rb
rspec-1.3.1 features/step_definitions/stubbing_steps.rb
rspec-1.3.1.rc features/step_definitions/stubbing_steps.rb
rspec-1.3.0 features/step_definitions/stubbing_steps.rb