ruby - RSpec.configure not working and examples fails due to rspec-mocks#setup -
i'am started rspec 3 months ago , i'am working in sinatra project (using ruby 2.1.1) ...
i don't have errors in specs (they're running in other computers) while running them on own got every single example ...
failure/error: unable find matching line backtrace argumenterror: wrong number of arguments (0 1) # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-mocks-2.14.6/lib/rspec/mocks.rb:10:in `setup' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/mocking_adapters/rspec.rb:17:in `setup_mocks_for_rspec' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example.rb:337:in `run_before_example' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example.rb:147:in `block in run' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example.rb:299:in `with_around_example_hooks' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example.rb:145:in `run' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example_group.rb:494:in `block in run_examples' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example_group.rb:490:in `map' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example_group.rb:490:in `run_examples' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example_group.rb:457:in `run' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example_group.rb:458:in `block in run' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example_group.rb:458:in `map' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example_group.rb:458:in `run' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:112:in `block (2 levels) in run_specs' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:112:in `map' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:112:in `block in run_specs' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/reporter.rb:54:in `report' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:108:in `run_specs' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:86:in `run' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:70:in `run' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:38:in `invoke' # /home/vagrant/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.0/exe/rspec:4:in `<top (required)>' # /home/vagrant/.rvm/gems/ruby-2.1.1/bin/rspec:23:in `load' # /home/vagrant/.rvm/gems/ruby-2.1.1/bin/rspec:23:in `<main>' # /home/vagrant/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval' # /home/vagrant/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>' # # showing full backtrace because every line filtered out. # see docs rspec::configuration#backtrace_exclusion_patterns , # rspec::configuration#backtrace_inclusion_patterns more information.
==========================
i used link (https://github.com/rspec/rspec-core/issues/754) it's not working me (my app in folder named projects) ...
i've tried use ruby 2.0.0 it's same issue ...
i'll happy read helpful writing ... thanks
the problem ruby load version of rspec or rspec-mock not corresponding code.
so fix sandbox gems.
#clean $ rm -rf .bundle gemfile.lock bin vendor #install $ bundle install --binstubs --path vendor #run $ bundle exec ruby yourfile.rb $ bin/rackup
with made sure project use specified gems gemfiles , not gem can surprisingly installed on system. can prevent crazy load path errors. recommend use every project.
Comments
Post a Comment