Sha256: f97a000588ecb219ee15a07fe97a3df51f7f92b77e583ef27c402ef09aa9a9c0

Contents?: true

Size: 763 Bytes

Versions: 120

Compression:

Stored size: 763 Bytes

Contents

# stub frameworks like to gum up Object, so this is deliberately
# set NOT to run so that you don't accidentally run it when you
# run this dir.

# To run it, stand in this directory and say:
#
#   RUN_FLEXMOCK_EXAMPLE=true ruby ../bin/spec mocking_with_flexmock.rb

if ENV['RUN_FLEXMOCK_EXAMPLE']
  Spec::Runner.configure do |config|
    config.mock_with :flexmock
  end

  describe "Flexmocks" do
    it "should fail when the expected message is received with wrong arguments" do
      m = flexmock("now flex!")
      m.should_receive(:msg).with("arg").once
      m.msg("other arg")
    end

    it "should fail when the expected message is not received at all" do
      m = flexmock("now flex!")
      m.should_receive(:msg).with("arg").once
    end
  end
end

Version data entries

120 entries across 120 versions & 21 rubygems

Version Path
media-path-0.1.1.pre vendor/rspec/examples/failing/mocking_with_flexmock.rb
simple-templater-0.0.1.2 vendor/rspec/examples/failing/mocking_with_flexmock.rb
media-path-0.1.1 vendor/rspec/examples/failing/mocking_with_flexmock.rb
simple-templater-0.0.1.1 vendor/rspec/examples/failing/mocking_with_flexmock.rb
pupu-0.0.2 vendor/rspec/examples/failing/mocking_with_flexmock.rb
rango-0.0.6 vendor/rspec/examples/failing/mocking_with_flexmock.rb
rango-0.1.pre vendor/rspec/examples/failing/mocking_with_flexmock.rb
pupu-0.0.1 vendor/rspec/examples/failing/mocking_with_flexmock.rb
media-path-0.1 vendor/rspec/examples/failing/mocking_with_flexmock.rb
simple-templater-0.0.1 vendor/rspec/examples/failing/mocking_with_flexmock.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/failing_examples/mocking_with_flexmock.rb
middleman-0.10.17 vendor/gems/gems/rspec-1.2.9/examples/failing/mocking_with_flexmock.rb
middleman-0.10.16 vendor/gems/gems/rspec-1.2.9/examples/failing/mocking_with_flexmock.rb
middleman-0.10.15 vendor/gems/gems/rspec-1.2.9/examples/failing/mocking_with_flexmock.rb
rackjour-0.1.8 vendor/gems/gems/rspec-1.2.9/examples/failing/mocking_with_flexmock.rb
middleman-0.10.14 vendor/gems/gems/rspec-1.2.9/examples/failing/mocking_with_flexmock.rb
ageweke-rspec-1.2.9 examples/failing/mocking_with_flexmock.rb
rspec-1.2.9 examples/failing/mocking_with_flexmock.rb
rspec-1.2.7 examples/failing/mocking_with_flexmock.rb
rspec-1.2.8 examples/failing/mocking_with_flexmock.rb