Ruby on Rails Wednesday, July 30, 2014



On Tuesday, 29 July 2014 15:53:58 UTC-4, byrnejb wrote:
If there is a list devoted to ActiveRecord problems then I would appreciate a redirect.  In the absence of same I need some assistance with part of RoRs stack, namely ActiveRecord and the testing thereof.  I have a cli project which only uses AR-4.0 and whatever other stuff that gem pulls in. I am trialing the project witjh AR-4.1 and I am getting this error when I try to run my cucumber features:

     
undefined method `assertions' for #<String:0x00000003ba4688> (NoMethodError)
      /home/byrnejb/Projects/Software/theHeart/code/hll_th_cadex_xfer/libexec/bundler/ruby/2.1.0/gems/rspec-expectations-3.0.3/lib/rspec/matchers.rb:902:in `
method_missing'
      /home/byrnejb/Projects/Software/theHeart/code/hll_th_cadex_xfer/libexec/bundler/ruby/2.1.0/gems/minitest-5.4.0/lib/minitest/assertions.rb:126:in `assert'

     
/usr/lib64/ruby/2.1.0/test/unit/assertions.rb:36:in `assert'
      /home/byrnejb/Projects/Software/theHeart/code/hll_th_cadex_xfer/features/step_definitions/hll_dbms_steps.rb:15:in `
find_table_model_for'
      /home/byrnejb/Projects/Software/theHeart/code/hll_th_cadex_xfer/features/step_definitions/hll_dbms_steps.rb:30:in `block in <top (required)>'


I googled for this and found a couple of tangential references relating to a change in minitest. However, the fix appears to be somewhat dated and in any case this is not a full RoR stack so rspec-rails is not applicable.


https://stackoverflow.com/questions/16867707/rails-4-and-rspec-undefined-method-assertions-in-routing-spec

This problem is caused by a change in minitest 5.0 documented here:
# https://github.com/seattlerb/minitest/issues/286
is fixed by using: gem "rspec-rails", '~> 2.14.0.rc1'
in the gemfile.



The underlying issue is mentioned here in Minitest:

https://github.com/seattlerb/minitest/blob/master/lib/minitest/assertions.rb#L8-L12

Whatever is including the `assert` functions needs to also define the `assertions` accessor.

Hard to advise further without seeing the relevant code in hll_dbms_steps.rb.

--Matt Jones 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a362c73a-68e6-4cde-8dff-17cd255cd34a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment