handshake icon indicating copy to clipboard operation
handshake copied to clipboard

The test suite fails

Open gregnavis opened this issue 9 years ago • 0 comments

Problem

After fixing Rakefile (see #4 and the corresponding issue #3) the test suite fails:

$ rake
/Users/grn/.rbenv/versions/2.1.5/bin/ruby -S rspec ./spec/handshake_spec.rb
Warning: you should require 'minitest/autorun' instead.
Warning: or add 'gem "minitest"' before 'require "minitest/autorun"'
From:
  /Users/grn/p/handshake/lib/handshake.rb:6:in `<top (required)>'
  /Users/grn/p/handshake/spec/handshake_spec.rb:2:in `<top (required)>'
  /Users/grn/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `load'
  /Users/grn/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `block in load_spec_files'
  /Users/grn/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `map'
  /Users/grn/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `load_spec_files'
  /Users/grn/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:22:in `run'
  /Users/grn/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
  /Users/grn/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
  /Users/grn/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
(eval):1: warning: redefining `object_id' may cause serious problems
(eval):1: warning: redefining `__send__' may cause serious problems
...........................FFFFFFF.......

Failures:

  1) Handshake before should check simple before conditions
     Failure/Error: lambda { SimpleBeforeCondition.new.call_fails }.should violate_contract
       expected #<Proc:0x007fdec3839a10@/Users/grn/p/handshake/spec/handshake_spec.rb:423 (lambda)> to violate contract
     # ./spec/handshake_spec.rb:423:in `block (3 levels) in <top (required)>'

  2) Handshake before should generate and cache no-op contracts
     Failure/Error: SimpleBeforeCondition.method_contracts.length.should == 2
       expected: 2
            got: 3 (using ==)
     # ./spec/handshake_spec.rb:428:in `block (3 levels) in <top (required)>'

  3) Handshake before should check before-conditions inherited from superclasses
     Failure/Error: lambda { ExtendsSimpleBeforeCondition.new.call_fails }.should violate_contract
       expected #<Proc:0x007fdec39956c0@/Users/grn/p/handshake/spec/handshake_spec.rb:433 (lambda)> to violate contract
     # ./spec/handshake_spec.rb:433:in `block (3 levels) in <top (required)>'

  4) Handshake before should check before-conditions that require the use of instance variables
     Failure/Error: lambda { ScopedBeforeCondition.new(false).call }.should violate_contract
       expected #<Proc:0x007fdec3a23128@/Users/grn/p/handshake/spec/handshake_spec.rb:445 (lambda)> to violate contract
     # ./spec/handshake_spec.rb:445:in `block (3 levels) in <top (required)>'

  5) Handshake before should check before-conditions that require the use of arguments
     Failure/Error: lambda { BeforeClauseAssert.new.call 3 }.should violate_contract
       expected #<Proc:0x007fdec3a208b0@/Users/grn/p/handshake/spec/handshake_spec.rb:462 (lambda)> to violate contract
     # ./spec/handshake_spec.rb:462:in `block (3 levels) in <top (required)>'

  6) Handshake after should check simple after-conditions
     Failure/Error: lambda { SimpleAfterCondition.new.call(false) }.should violate_contract
       expected #<Proc:0x007fdec3990e18@/Users/grn/p/handshake/spec/handshake_spec.rb:478 (lambda)> to violate contract
     # ./spec/handshake_spec.rb:478:in `block (3 levels) in <top (required)>'

  7) Handshake around should check simple around-conditions
     Failure/Error: lambda { SimpleAroundCondition.new.call(val) }.should violate_contract
       expected #<Proc:0x007fdec39888a8@/Users/grn/p/handshake/spec/handshake_spec.rb:494 (lambda)> to violate contract
     # ./spec/handshake_spec.rb:494:in `block (4 levels) in <top (required)>'
     # ./spec/handshake_spec.rb:493:in `each'
     # ./spec/handshake_spec.rb:493:in `block (3 levels) in <top (required)>'

Finished in 0.04368 seconds
41 examples, 7 failures

Failed examples:

rspec ./spec/handshake_spec.rb:420 # Handshake before should check simple before conditions
rspec ./spec/handshake_spec.rb:426 # Handshake before should generate and cache no-op contracts
rspec ./spec/handshake_spec.rb:432 # Handshake before should check before-conditions inherited from superclasses
rspec ./spec/handshake_spec.rb:444 # Handshake before should check before-conditions that require the use of instance variables
rspec ./spec/handshake_spec.rb:461 # Handshake before should check before-conditions that require the use of arguments
rspec ./spec/handshake_spec.rb:475 # Handshake after should check simple after-conditions
rspec ./spec/handshake_spec.rb:492 # Handshake around should check simple around-conditions
rake aborted!
/Users/grn/.rbenv/versions/2.1.5/bin/ruby -S rspec ./spec/handshake_spec.rb failed

Tasks: TOP => default => spec
(See full trace by running task with --trace)

The output indicates at least three problems:

  1. a problem with Minitest in handshake.rb
  2. warnings about overriding object_id (reported in #2) and __send__
  3. 7 failing test cases

gregnavis avatar May 29 '15 11:05 gregnavis