mbklein / confstruct

Yet another hash/struct-like configuration object for Ruby
190 stars 9 forks source link

running tests? #22

Open jrochkind opened 9 years ago

jrochkind commented 9 years ago

Travis shows all passing in master... but if I run tests myself, I get failures. Very odd and confusing. Any ideas?

Actually, Travis last ran tests 9 months ago -- I bet if it were to run tests again today with new versions of rspec and other dependencies, it would fail. I think that's what's going on.

$ bundle exec rake
/opt/rubies/ruby-2.0.0-p576/bin/ruby -I/Users/jrochkind/.gem/ruby/2.0.0/gems/rspec-core-3.1.7/lib:/Users/jrochkind/.gem/ruby/2.0.0/gems/rspec-support-3.1.2/lib /Users/jrochkind/.gem/ruby/2.0.0/gems/rspec-core-3.1.7/exe/rspec --pattern ./spec/\*\*/\*_spec.rb
FF........F.F.....F..........F....FF..*.FFF

Pending:
  Confstruct::HashWithStructAccess delegation should gracefully handle being extended
    # probably won't fix due to the unpredictable way ActiveSupport injects #presence()
    # ./spec/confstruct/hash_with_struct_access_spec.rb:259

Failures:

  1) Confstruct::Configuration should initialize empty
     Failure/Error: conf.is_a?(Hash).should be_true
       expected true to respond to `true?`
     # ./spec/confstruct/configuration_spec.rb:7:in `block (2 levels) in <top (required)>'

  2) Confstruct::Configuration should initialize properly from a nested hash with string keys
     Failure/Error: conf.is_a?(Hash).should be_true
       expected true to respond to `true?`
     # ./spec/confstruct/configuration_spec.rb:15:in `block (2 levels) in <top (required)>'

  3) Confstruct::Configuration configuration should call #after_config! when configuration is complete
     Failure/Error: postconfigurator = RSpec::Mocks::Mock.new('after_config!')
     NameError:
       uninitialized constant RSpec::Mocks::Mock
     # ./spec/confstruct/configuration_spec.rb:119:in `block (3 levels) in <top (required)>'

  4) Confstruct::HashWithStructAccess should initialize empty
     Failure/Error: hwsa.is_a?(Hash).should be_true
       expected true to respond to `true?`
     # ./spec/confstruct/hash_with_struct_access_spec.rb:7:in `block (2 levels) in <top (required)>'

  5) Confstruct::HashWithStructAccess data manipulation should properly respond to #has?
     Failure/Error: @hwsa.has?('github.url').should be_true
       expected true to respond to `true?`
     # ./spec/confstruct/hash_with_struct_access_spec.rb:70:in `block (3 levels) in <top (required)>'

  6) Confstruct::HashWithStructAccess Proc values as virtual methods should only evaluate Confstruct::Deferred procs
     Failure/Error: @hwsa.github.regular_proc.is_a?(Proc).should be_true
       expected true to respond to `true?`
     # ./spec/confstruct/hash_with_struct_access_spec.rb:195:in `block (3 levels) in <top (required)>'

  7) Confstruct::HashWithStructAccess Proc values as virtual methods should allow definition of deferreds in block mode
     Failure/Error: @hwsa.github.defproc.is_a?(Proc).should be_false
       expected false to respond to `false?`
     # ./spec/confstruct/hash_with_struct_access_spec.rb:224:in `block (3 levels) in <top (required)>'

  8) Confstruct::HashWithStructAccess Proc values as virtual methods should handle i18n translations
     Failure/Error: I18n = RSpec::Mocks::Mock.new('I18n')
     NameError:
       uninitialized constant RSpec::Mocks::Mock
     # ./spec/confstruct/hash_with_struct_access_spec.rb:231:in `block (3 levels) in <top (required)>'

  9) Kernel.eval_or_yield should instance_eval when the block takes no params
     Failure/Error: @obj = RSpec::Mocks::Mock.new('obj')
     NameError:
       uninitialized constant RSpec::Mocks::Mock
     # ./spec/confstruct/utils_spec.rb:5:in `block (2 levels) in <top (required)>'

  10) Kernel.eval_or_yield should yield when the block takes a param
     Failure/Error: @obj = RSpec::Mocks::Mock.new('obj')
     NameError:
       uninitialized constant RSpec::Mocks::Mock
     # ./spec/confstruct/utils_spec.rb:5:in `block (2 levels) in <top (required)>'

  11) Kernel.eval_or_yield should return the object when no block is given
     Failure/Error: @obj = RSpec::Mocks::Mock.new('obj')
     NameError:
       uninitialized constant RSpec::Mocks::Mock
     # ./spec/confstruct/utils_spec.rb:5:in `block (2 levels) in <top (required)>'

Deprecation Warnings:

Requiring `rspec/autorun` when running RSpec via the `rspec` command is deprecated. Called from /Users/jrochkind/code/confstruct/spec/spec_helper.rb:6:in `require'.

Using `should` from rspec-expectations' old `:should` syntax without explicitly enabling the syntax is deprecated. Use the new `:expect` syntax or explicitly enable `:should` instead. Called from /Users/jrochkind/code/confstruct/spec/confstruct/configuration_spec.rb:7:in `block (2 levels) in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
`config.raise_errors_for_deprecations!`, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

2 deprecation warnings total

Finished in 0.0167 seconds (files took 0.13942 seconds to load)
43 examples, 11 failures, 1 pending

Failed examples:

rspec ./spec/confstruct/configuration_spec.rb:5 # Confstruct::Configuration should initialize empty
rspec ./spec/confstruct/configuration_spec.rb:12 # Confstruct::Configuration should initialize properly from a nested hash with string keys
rspec ./spec/confstruct/configuration_spec.rb:118 # Confstruct::Configuration configuration should call #after_config! when configuration is complete
rspec ./spec/confstruct/hash_with_struct_access_spec.rb:5 # Confstruct::HashWithStructAccess should initialize empty
rspec ./spec/confstruct/hash_with_struct_access_spec.rb:69 # Confstruct::HashWithStructAccess data manipulation should properly respond to #has?
rspec ./spec/confstruct/hash_with_struct_access_spec.rb:194 # Confstruct::HashWithStructAccess Proc values as virtual methods should only evaluate Confstruct::Deferred procs
rspec ./spec/confstruct/hash_with_struct_access_spec.rb:219 # Confstruct::HashWithStructAccess Proc values as virtual methods should allow definition of deferreds in block mode
rspec ./spec/confstruct/hash_with_struct_access_spec.rb:229 # Confstruct::HashWithStructAccess Proc values as virtual methods should handle i18n translations
rspec ./spec/confstruct/utils_spec.rb:8 # Kernel.eval_or_yield should instance_eval when the block takes no params
rspec ./spec/confstruct/utils_spec.rb:16 # Kernel.eval_or_yield should yield when the block takes a param
rspec ./spec/confstruct/utils_spec.rb:26 # Kernel.eval_or_yield should return the object when no block is given
Coverage report generated for RSpec to /Users/jrochkind/code/confstruct/coverage. 299 / 340 LOC (87.94%) covered.
/opt/rubies/ruby-2.0.0-p576/bin/ruby -I/Users/jrochkind/.gem/ruby/2.0.0/gems/rspec-core-3.1.7/lib:/Users/jrochkind/.gem/ruby/2.0.0/gems/rspec-support-3.1.2/lib /Users/jrochkind/.gem/ruby/2.0.0/gems/rspec-core-3.1.7/exe/rspec --pattern ./spec/\*\*/\*_spec.rb failed
msel-sysmac14:confstruct jrochkind$
jrochkind commented 9 years ago

Ah yes, it's rspec 2 vs 3.

Tests pass (with many many deprecation notices) for last rspec 2.x, but fail for 3.x.