Tag: rspec

Unable to identify the object from ruby library

I recently updated the OS to ELcaptain and ever since my feature files are failing and not identifying object. This is the error I get in terminal when I run a file: cannot load such file — rspec (LoadError) /Users/xyz/.rvm/rubies/ruby-2.1.6/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:128:in `require’ /Users/xyz/.rvm/rubies/ruby-2.1.6/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require’ /Users/xyz/.rvm/rubies/ruby-2.1.6/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:39:in `require’ /Users/xyz/ttv-cucumber/helper/auto_loader.rb:14:in `<top (required)>’ /Users/xyz/ttv-cucumber/flow-combo-selection/features/support/common.rb:1:in `require_relative’ /Users/xyzr/ttv-cucumber/flow-combo-selection/features/support/common.rb:1:in `<top (required)>’ […]

Rails Gemes versions and the `Gemfile` compiled have problems?

I have a very big project developed in certain test version, the project run well, but there are a problem with the rspec, the Gemfile and the Gemfile.lock, some of the developers have updated some gems but didn’t remove the old Gemfile.lock, so we did not had any problem with the project because the Gemfile […]

Testing modules in rspec

What are the best practices on testing modules in rspec? I have some modules that get included in few models and for now I simply have duplicate tests for each model (with few differences). Is there a way to DRY it up?

Problems with RSpec and Chronic

I’m trying to use Chronic inside my non-rails project. When I try to get the specs with ‘spec’ I get the following error: $ spec spec/parsers/parser_english_spec.rb /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require’: no such file to load — chronic (LoadError) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require’ from ./spec/parsers/../../lib/recurring_events.rb:6 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require’ from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require’ from ./spec/parsers/../spec_helper.rb:3 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require’ from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require’ […]

Rspec failure when it should be passing

When I run bundle exec rspec spec/ I have one of my tests fail that should be passing. Here’s the error: Failure/Error: @user = Factory(:user) NoMethodError: undefined method `Factory’ for #<RSpec::Core::ExampleGroup::Nested_2::Nested_2:0x1037c0a70> # ./spec/controllers/users_controller_spec.rb:21 Here’s the test code: describe “GET ‘show'” do before(:each) do @user = Factory(:user) end it “should be successful” do get :show, :id […]

Invalid option: gem check -t mail

I’m trying to run the unit tests on the mail gem, but I get the following. I’ve done this in accordance with the gem manual here http://docs.rubygems.org/read/chapter/10 > gem check -t mail ERROR: While executing gem … (OptionParser::InvalidOption) invalid option: -t What am I doing wrong?

When installing a gem, should only the library get installed, or should the executable get installed as well?

I have installed RSpec with the gem (gem install rspec) command. Everything went ok. If I try to reinstall it again, I get a message like it has already been installed. When I try to use rspec from the command line on Ubuntu, the terminal can’t find the program. My question is does the gem […]

Unable to record Whois requests with VCR?

I’m attempting to use VCR 2.0.0 outside of Rails. VCR seems to create the vcr_cassettes directory perfectly when I run the specs. However, the tests seem to be still hitting the network and there are never any yaml cassettes to be found in the cassette directory. Any ideas what I’m doing wrong? Here is an […]

Ruby gem Sanitize not condensing whitespace on one machine

I have the following failing unit test; it “should handle white space” do Sanitize.clean(‘ ‘).should == ” end Which fails because the result of Sanitize.clean(‘ ‘) is ‘ ‘ not ”. The same test on other people’s machines works fine, which lead me down the track of maybe an incorrect gem being installed but I […]

Autotest is not loading in ruby on rails environment

I am having a problem with autotest. it doesn’t seem to load as tutorial videos I have been seeing. this is what happens , it somewhat “freezes” and nothing is happening. As i speak : $ autotest -rails loading autotest/rails_rspec2 Also , when I run the server command , it shows that it needs ZenTest […]

Ruby is the best programming language in the world - Ruby on Rails.