Note that there are some explanatory texts on larger screens.

plurals
  1. POError running rspec test in rails
    text
    copied!<p>Hi I have created a test case in spec/myprocess as follows</p> <pre><code>before :each do @my_base = MyBase.new end describe "new_my_base" do it "should not take any arguments and retuens a MyBase object" do @my_base.should be_an_instance_of MyBase end end describe "#my_path" do it "returns the correct mybase file path" do $path.should eql App::Application.config.my_encode_type.to_s end end </code></pre> <p>and when I tun rspec spec/lib/mybasetest.rb it throws me the following error.</p> <pre><code>kalanamith@kalanamith:~/Documents/projects/leena$ rspec spec/lib/mybasetest.rb *** Mocha deprecation warning: Change `require 'mocha'` to `require 'mocha/setup'`. /var/lib/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require': iconv will be deprecated in the future, use String#encode instead. *** Mocha deprecation warning: `require 'mocha/standalone'` has been deprecated. Please use `require 'mocha/api' instead. /var/lib/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- mocha/object (LoadError) /home/kalanamith/Documents/projects/fakturabank/spec/lib/mybasetest.rb:4:in `&lt;top (required)&gt;': undefined method `before' for main:Object (NoMethodError) from /var/lib/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load' from /var/lib/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `block in load_spec_files' from /var/lib/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `map' from /var/lib/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load_spec_files' from /var/lib/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/command_line.rb:22:in `run' from /var/lib/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:69:in `run' from /var/lib/gems/1.9.1/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:10:in `block in autorun' </code></pre> <p>This is my gem file</p> <pre><code>source 'https://rubygems.org' gem 'rails', '3.2.13' gem 'jquery-rails' , '3.0.0' gem 'pg' # Gems used only for assets and not required # in production environments by default. group :assets do gem 'sass-rails', '~&gt; 3.2.3' gem 'coffee-rails', '~&gt; 3.2.1' gem 'uglifier', '&gt;= 1.0.3' end group :development, :test do gem 'rails-dev-tweaks', '~&gt; 0.6.1' gem 'debugger' gem 'rspec-rails', '2.10.0' gem 'annotate' gem 'factory_girl_rails' gem 'shoulda-matchers' gem 'simplecov', :require =&gt; false gem 'simplecov-rcov', :require =&gt; false gem 'pry' gem "guard-rspec" end group :test do gem 'mocha' end group :test do gem "webmock" end gem 'debugger' # This gem works with ruby 1.9.3 it wraps these other things gem 'savon', "~&gt; 1.2.0" gem 'airbrake' gem 'aasm' gem 'paranoia' gem 'acts_as_tree' gem 'will_paginate' gem 'translate-rails3' gem 'wicked_pdf' gem 'activemerchant' gem 'libxml-ruby' gem 'libxslt-ruby' gem 'ruby-xslt' gem 'exception_notification', :require =&gt; 'exception_notifier' gem "uuidtools", "~&gt; 2.1.3" gem "ruby-filemagic" gem "rmagick", :require =&gt; false gem "rubyzip" gem "spreadsheet" gem "multi_json" gem "multi_xml" gem "httparty" #FormBuilder backwards compatibility gem "dynamic_form" gem "prototype-rails" gem "formtastic" gem "net-ssh" gem "net-scp" </code></pre> <p>Um quite new to rails and this is my first experience with rspec framework . I will be grateful if anyone can assist me. Thank you in advance</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload