Test suite YAML issues #174

Closed
voxik opened this Issue Aug 16, 2012 · 20 comments

Comments

Projects
None yet
4 participants

voxik commented Aug 16, 2012

Hi,

I have issues to run rspec-mocks 2.11.2 test suite with Ruby 1.9.3:

  1) RSpec::Mocks::Serialization without YAML loaded does not add #to_yaml to the stubbed object
     Failure/Error: @orig_yaml_constant = Object.send(:remove_const, :YAML)
     NameError:
       constant Object::YAML not defined
     # /builddir/build/BUILD/rubygem-rspec-mocks-2.11.2/usr/share/gems/gems/rspec-mocks-2.11.2/spec/rspec/mocks/serialization_spec.rb:31:in `remove_const'
     # /builddir/build/BUILD/rubygem-rspec-mocks-2.11.2/usr/share/gems/gems/rspec-mocks-2.11.2/spec/rspec/mocks/serialization_spec.rb:31:in `block (2 levels) in without_yaml_loaded'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:35:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:35:in `run_in'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `block in run_all'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `run_all'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:368:in `run_hook'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `block in run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:217:in `run_before_each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:79:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:173:in `with_around_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:77:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:355:in `block in run_examples'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:351:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:351:in `run_examples'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:337:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:34:in `report'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:25:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
  2) RSpec::Mocks::Serialization with YAML loaded using Syck as the YAML engine behaves like normal YAML serialization serializes to yaml the same with and without stubbing, using #to_yaml
     Failure/Error: before(:each) { YAML::ENGINE.yamler = 'syck' }
     NameError:
       uninitialized constant RSpec::Mocks::ENGINE
     Shared Example Group: "normal YAML serialization" called from 
     # /builddir/build/BUILD/rubygem-rspec-mocks-2.11.2/usr/share/gems/gems/rspec-mocks-2.11.2/spec/rspec/mocks/serialization_spec.rb:76:in `block (4 levels) in <module:Mocks>'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:35:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:35:in `run_in'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `block in run_all'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `run_all'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:368:in `run_hook'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `block in run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:217:in `run_before_each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:79:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:173:in `with_around_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:77:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:355:in `block in run_examples'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:351:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:351:in `run_examples'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:337:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:34:in `report'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:25:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
  3) RSpec::Mocks::Serialization with YAML loaded using Syck as the YAML engine behaves like normal YAML serialization serializes to yaml the same with and without stubbing, using YAML.dump
     Failure/Error: before(:each) { YAML::ENGINE.yamler = 'syck' }
     NameError:
       uninitialized constant RSpec::Mocks::ENGINE
     Shared Example Group: "normal YAML serialization" called from 
     # /builddir/build/BUILD/rubygem-rspec-mocks-2.11.2/usr/share/gems/gems/rspec-mocks-2.11.2/spec/rspec/mocks/serialization_spec.rb:76:in `block (4 levels) in <module:Mocks>'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:35:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:35:in `run_in'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `block in run_all'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `run_all'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:368:in `run_hook'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `block in run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:217:in `run_before_each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:79:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:173:in `with_around_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:77:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:355:in `block in run_examples'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:351:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:351:in `run_examples'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:337:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:34:in `report'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:25:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
  4) RSpec::Mocks::Serialization with YAML loaded using Psych as the YAML engine behaves like normal YAML serialization serializes to yaml the same with and without stubbing, using #to_yaml
     Failure/Error: before(:each) { YAML::ENGINE.yamler = 'psych' }
     NameError:
       uninitialized constant RSpec::Mocks::ENGINE
     Shared Example Group: "normal YAML serialization" called from 
     # /builddir/build/BUILD/rubygem-rspec-mocks-2.11.2/usr/share/gems/gems/rspec-mocks-2.11.2/spec/rspec/mocks/serialization_spec.rb:81:in `block (4 levels) in <module:Mocks>'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:35:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:35:in `run_in'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `block in run_all'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `run_all'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:368:in `run_hook'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `block in run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:217:in `run_before_each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:79:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:173:in `with_around_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:77:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:355:in `block in run_examples'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:351:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:351:in `run_examples'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:337:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:34:in `report'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:25:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
  5) RSpec::Mocks::Serialization with YAML loaded using Psych as the YAML engine behaves like normal YAML serialization serializes to yaml the same with and without stubbing, using YAML.dump
     Failure/Error: before(:each) { YAML::ENGINE.yamler = 'psych' }
     NameError:
       uninitialized constant RSpec::Mocks::ENGINE
     Shared Example Group: "normal YAML serialization" called from 
     # /builddir/build/BUILD/rubygem-rspec-mocks-2.11.2/usr/share/gems/gems/rspec-mocks-2.11.2/spec/rspec/mocks/serialization_spec.rb:81:in `block (4 levels) in <module:Mocks>'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:35:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:35:in `run_in'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `block in run_all'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:70:in `run_all'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:368:in `run_hook'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `block in run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:292:in `run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:217:in `run_before_each'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:79:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:173:in `with_around_hooks'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example.rb:77:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:355:in `block in run_examples'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:351:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:351:in `run_examples'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:337:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:338:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `map'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:28:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:34:in `report'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:25:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
     # /usr/share/gems/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
Finished in 0.26069 seconds
587 examples, 5 failures, 2 pending

using following command:

$ ruby -Ilib/ -S rspec spec/

These are gems I have installed on my system:

$ gem list

*** LOCAL GEMS ***

bigdecimal (1.1.0)
diff-lcs (1.1.2)
io-console (0.3)
json (1.6.5)
rake (0.9.2.2)
rdoc (3.12)
rspec-core (2.8.0)
rspec-expectations (2.8.0)
rspec-mocks (2.8.0)

Any idea what is going wrong? Thank you

Owner

dchelimsky commented Aug 16, 2012

I don't know if this is the source of your issue, but the backtrace shows rspec-mocks-2.11 and rspec-core-2.8. Try aligning the rspec libs so they're all on the same minor version (i.e. 2.11.x) and see if the problem goes away. If it doesn't, please post the code and spec so we can see what the interaction w/ YAML is.

Owner

dchelimsky commented Aug 16, 2012

Oh - wait - you're running rspec's own suite? Then the issue is most likely that you need to run the same minor version of rspec-core and expectations as well.

voxik commented Aug 16, 2012

That is correct ... I am running rspec-mocks 2.11.2 test suite using rspec-core and rspec-expectations 2.8.0. You are right, that might be issue. I'll give it try. The circular dependency is a bit pain when updating RSpecs in Fedora. Sorry for bothering you.

voxik commented Aug 17, 2012

Unfortunately no luck:

  1) RSpec::Mocks::Serialization with YAML loaded using Psych as the YAML engine behaves like normal YAML serialization serializes to yaml the same with and without stubbing, using YAML.dump
     Failure/Error: before(:each) { YAML::ENGINE.yamler = 'psych' }
     NameError:
       uninitialized constant RSpec::Mocks::YAML
     Shared Example Group: "normal YAML serialization" called from ./spec/rspec/mocks/serialization_spec.rb:82
     # /builddir/build/BUILD/rubygem-rspec-mocks-2.11.2/usr/share/gems/gems/rspec-mocks-2.11.2/spec/rspec/mocks/serialization_spec.rb:81:in `block (4 levels) in <module:Mocks>'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:236:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:236:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:23:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `each'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:424:in `run_hook'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:323:in `run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:299:in `run_before_each'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:112:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:253:in `with_around_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:110:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:378:in `block in run_examples'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `run_examples'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:360:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/reporter.rb:34:in `report'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:25:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'
  2) RSpec::Mocks::Serialization with YAML loaded using Psych as the YAML engine behaves like normal YAML serialization serializes to yaml the same with and without stubbing, using #to_yaml
     Failure/Error: before(:each) { YAML::ENGINE.yamler = 'psych' }
     NameError:
       uninitialized constant RSpec::Mocks::YAML
     Shared Example Group: "normal YAML serialization" called from ./spec/rspec/mocks/serialization_spec.rb:82
     # /builddir/build/BUILD/rubygem-rspec-mocks-2.11.2/usr/share/gems/gems/rspec-mocks-2.11.2/spec/rspec/mocks/serialization_spec.rb:81:in `block (4 levels) in <module:Mocks>'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:236:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:236:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:23:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `each'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:424:in `run_hook'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:323:in `run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:299:in `run_before_each'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:112:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:253:in `with_around_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:110:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:378:in `block in run_examples'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `run_examples'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:360:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/reporter.rb:34:in `report'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:25:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'
  3) RSpec::Mocks::Serialization with YAML loaded using Syck as the YAML engine behaves like normal YAML serialization serializes to yaml the same with and without stubbing, using YAML.dump
     Failure/Error: before(:each) { YAML::ENGINE.yamler = 'syck' }
     NameError:
       uninitialized constant RSpec::Mocks::YAML
     Shared Example Group: "normal YAML serialization" called from ./spec/rspec/mocks/serialization_spec.rb:77
     # /builddir/build/BUILD/rubygem-rspec-mocks-2.11.2/usr/share/gems/gems/rspec-mocks-2.11.2/spec/rspec/mocks/serialization_spec.rb:76:in `block (4 levels) in <module:Mocks>'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:236:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:236:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:23:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `each'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:424:in `run_hook'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:323:in `run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:299:in `run_before_each'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:112:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:253:in `with_around_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:110:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:378:in `block in run_examples'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `run_examples'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:360:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/reporter.rb:34:in `report'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:25:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'
  4) RSpec::Mocks::Serialization with YAML loaded using Syck as the YAML engine behaves like normal YAML serialization serializes to yaml the same with and without stubbing, using #to_yaml
     Failure/Error: before(:each) { YAML::ENGINE.yamler = 'syck' }
     NameError:
       uninitialized constant RSpec::Mocks::YAML
     Shared Example Group: "normal YAML serialization" called from ./spec/rspec/mocks/serialization_spec.rb:77
     # /builddir/build/BUILD/rubygem-rspec-mocks-2.11.2/usr/share/gems/gems/rspec-mocks-2.11.2/spec/rspec/mocks/serialization_spec.rb:76:in `block (4 levels) in <module:Mocks>'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:236:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:236:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:23:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `each'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:424:in `run_hook'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:323:in `run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:299:in `run_before_each'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:112:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:253:in `with_around_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:110:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:378:in `block in run_examples'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `run_examples'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:360:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/reporter.rb:34:in `report'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:25:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'
  5) RSpec::Mocks::Serialization without YAML loaded does not add #to_yaml to the stubbed object
     Failure/Error: @orig_yaml_constant = Object.send(:remove_const, :YAML)
     NameError:
       constant Object::YAML not defined
     # /builddir/build/BUILD/rubygem-rspec-mocks-2.11.2/usr/share/gems/gems/rspec-mocks-2.11.2/spec/rspec/mocks/serialization_spec.rb:31:in `remove_const'
     # /builddir/build/BUILD/rubygem-rspec-mocks-2.11.2/usr/share/gems/gems/rspec-mocks-2.11.2/spec/rspec/mocks/serialization_spec.rb:31:in `block (2 levels) in without_yaml_loaded'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:236:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:236:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:23:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `each'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:424:in `run_hook'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:323:in `run_before_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:299:in `run_before_each'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:112:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:253:in `with_around_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:110:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:378:in `block in run_examples'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `run_examples'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:360:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/reporter.rb:34:in `report'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:25:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'
Owner

myronmarston commented Aug 17, 2012

I believe the specs all pass when the entire suite is run (bundle exec rspec spec), but it'd be good if each spec passed in isolation, so I'll see if I can fix that. Thanks.

Contributor

alindeman commented Aug 17, 2012

Maybe just a missing require 'yaml'?

voxik commented Aug 20, 2012

@alindeman

Yes, that solves my issues. So I can run the test suite with following command:

ruby -ryaml -Ilib/ -S rspec spec/

Could you add the require on some appropriate place, please? I tried to add it into lib/rspec/mocks/serialization.rb which fixes 4 of the 5 failures, but still one failure remains.

Owner

myronmarston commented Aug 20, 2012

I'll take a look at fixing this (I'm the author of the original YAML code in rspec-mocks). I'll try to get to it later today but it might be later this week.

I've got a script (that I originally got from Gary Bernhardt) that runs all the specs for a project together, and then runs each spec file separately in isolation -- the idea being that you want all spec files to be runnable on their own. It would catch issues like this if we added it to the CI build, so I'll also take a look at doing that.

Owner

myronmarston commented Aug 24, 2012

I can't repro the error. Here's my shell session:

➜  rspec-mocks git:(master) rvm use 1.8.7@rspec
Using /Users/myron/.rvm/gems/ruby-1.8.7-p352 with gemset rspec
➜  rspec-mocks git:(master) bundle exec rspec spec/rspec/mocks/serialization_spec.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
.....

Finished in 0.00606 seconds
5 examples, 0 failures

Randomized with seed 42465

➜  rspec-mocks git:(master) rvm use 1.9.2@rspec
Using /Users/myron/.rvm/gems/ruby-1.9.2-p290 with gemset rspec
➜  rspec-mocks git:(master) bundle exec rspec spec/rspec/mocks/serialization_spec.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
.......

Finished in 0.05471 seconds
7 examples, 0 failures

Randomized with seed 36128

➜  rspec-mocks git:(master) rvm use 1.9.3@rspec
Using /Users/myron/.rvm/gems/ruby-1.9.3-p194 with gemset rspec
➜  rspec-mocks git:(master) bundle exec rspec spec/rspec/mocks/serialization_spec.rb
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
.......

Finished in 0.05048 seconds
7 examples, 0 failures

Randomized with seed 31424

How are you running the spec?

Contributor

alindeman commented Aug 24, 2012

@myronmarston, I've been able to reproduce by running rspec without the bundle exec prefix.

rspec spec # fails
bundle exec rspec spec # works correctly
Owner

dchelimsky commented Aug 24, 2012

@alindeman I think that is a separate issue. If you're able to use rspec to run rspec's own suite locally, that means you have rspec installed and you're loading an unfortunate blend of files from the installed version and the local copy. bundle exec resolves that.

The issue at hand here relates to running an individual spec file.

Contributor

alindeman commented Aug 24, 2012

Hmm. Thoughts on this?

[rspec-mocks] rspec spec/rspec/mocks/serialization_spec.rb | egrep "\d+ examples"
7 examples, 5 failures
[rspec-mocks] bundle exec rspec spec/rspec/mocks/serialization_spec.rb | egrep "\d+ examples"
7 examples, 0 failures
Contributor

alindeman commented Aug 24, 2012

Hmm, I think I see what you are saying. I will dig a bit farther.

Contributor

alindeman commented Aug 24, 2012

[rspec-mocks] ruby -I../rspec-core/lib -I../rspec-expectations/lib -S ../rspec-core/exe/rspec spec/rspec/mocks/serialization_spec.rb | egrep '\d examples'
7 examples, 5 failures
[rspec-mocks] ruby -I../rspec-core/lib -I../rspec-expectations/lib -S bundle exec ../rspec-core/exe/rspec spec/rspec/mocks/serialization_spec.rb | egrep '\d examples'
7 examples, 0 failures
Owner

myronmarston commented Aug 24, 2012

Hmm, so it looks like if you jump through hoops to avoid using bundler but to use the local rspec check out, then you can repro the failure. I suspect it relates to bundler loading YAML.

The question is: do we want to support running specs w/o bundler? Last night I updated rspec-core to make it run each spec file individually as part of the CI build:

rspec/rspec-core@d35b6b5

It surfaced a couple of failures w/ missing requires. The same test_all script here passes, but that's because it uses bundle exec. If we're going to support running the specs w/o bundler I should probably update that to run w/o bundler -- but I'm not sure if it even makes sense to support that?

Owner

dchelimsky commented Aug 24, 2012

The question is: do we want to support running specs w/o bundler?

Yes. Ideally, you should be able to do this:

gem install rspec
gem unpack rspec-core
cd rspec-core-2.11.1
rspec spec

myronmarston added a commit that referenced this issue Aug 24, 2012

Run all specs together and in isolation w/o bundler as part of the bu…
…ild.

We want these to always pass this way, so having it as part of the build is important.

This should help prevent a regression for #174 and issues like it.
Owner

myronmarston commented Aug 24, 2012

OK, I just pushed a fix, and pushed a change to our build to run all specs together and in isolation, w/o loading bundler at runtime. I'm particularly interested in feedback on my approach here:

16313fb

It "works for me", so to speak, but is the approach generally sound?

Owner

myronmarston commented Aug 24, 2012

Oh yeah, one nice side effect of not loading bundler at runtime is that script/test_all is so much faster. Compare how long it takes vs. the one I checked into rspec-core last night (which does load bundler).

myronmarston added a commit that referenced this issue Aug 24, 2012

Explicitly load psych.
This is needed on 1.9.2 to get the serialization specs to pass when run in isolation w/o bundler.

For #174.

myronmarston added a commit to rspec/rspec-core that referenced this issue Aug 25, 2012

Update script/test_all so that it runs specs w/o loading bundler.
As per rspec/rspec-mocks#174, we want all specs to pass when run in isolation w/o bundler being loaded, so this helps us ensure that remains true.

Also, running w/o bundler in this fashion is about 3x faster than using bundle exec.

voxik commented Oct 11, 2012

2.11.3 appears to have fixed this issue. Thank you and sorry for the delay.

Owner

myronmarston commented Oct 11, 2012

@voxik -- thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment