Sha256: 7117a9a2b7c2bf47ab293f343dd5558f00df6e2772372a6ce2a0658c9c5a0b82

Contents?: true

Size: 770 Bytes

Versions: 19

Compression:

Stored size: 770 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_framework = :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

19 entries across 19 versions & 1 rubygems

Version Path
rspec-core-2.0.0.beta.9 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.beta.8 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.beta.7 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.beta.6 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.beta.5 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.beta.4 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.beta.3 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.beta.2 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.beta.1 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.a10 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.a9 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.a8 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.a7 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.a6 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.a5 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.a4 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.a3 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.a2 example_specs/failing/mocking_with_flexmock.rb
rspec-core-2.0.0.a1 example_specs/failing/mocking_with_flexmock.rb