6 Replies Last post: Jun 26, 2014 6:02 PM by geoff swartz  
geoff swartz Newbie 9 posts since
Jun 19, 2009
Currently Being Moderated

Jun 25, 2014 10:14 PM

can't run tests on spec folder

I've tried to follow the help guide as much as I can (and as much as I understand) but I cannot get rubymine to run tests on the test folder (spec) or any child folders.  If I select a spec file, the test runs fine, but selecting the spec folder and then selecting "run all specs" gives me a result of "No tests were found".  In the log window I have the following...

 

/home/parallels/.rvm/rubies/ruby-2.1.2/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/parallels/.rvm/gems/ruby-2.1.2/bin/rspec /home/parallels/Code/BB3/src/spec --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter --pattern **/*_spec.rb

Testing started at 2:11 PM ...

/home/parallels/Code/BB3/src/spec/controllers/companies_controller_spec.rb:3:in `<top (required)>': uninitialized constant CompaniesController (NameError)

from /home/parallels/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.0.0/lib/rspec/core/configuration.rb:1051:in `load'

from /home/parallels/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.0.0/lib/rspec/core/configuration.rb:1051:in `block in load_spec_files'

from /home/parallels/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.0.0/lib/rspec/core/configuration.rb:1051:in `each'

from /home/parallels/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.0.0/lib/rspec/core/configuration.rb:1051:in `load_spec_files'

from /home/parallels/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:97:in `setup'

from /home/parallels/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:85:in `run'

from /home/parallels/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:70:in `run'

from /home/parallels/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:38:in `invoke'

from /home/parallels/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.0.0/exe/rspec:4:in `<top (required)>'

from /home/parallels/.rvm/gems/ruby-2.1.2/bin/rspec:23:in `load'

from /home/parallels/.rvm/gems/ruby-2.1.2/bin/rspec:23:in `<top (required)>'

from -e:1:in `load'

from -e:1:in `<main>'

 

Process finished with exit code 1

Empty test suite.

 

 

Line 3 in my companies_controller_spec (which is the first spec in the first folder) is RSpec.describe CompaniesController, :type => :controller do  So based on the error message it sounds like there's an issue with the test.  However if I run the test by itself it runs fine.  And if I run rspec from the terminal it runs all specs in all folders just fine.

So, how can I get it to run all specs in my spec folder?  It's a breeze to open a terminal and type rspec to run all my tests.  Rubymine is supposed to make things easier not harder.
Oleg Sukhodolsky JetBrains 804 posts since
Apr 4, 2012
Currently Being Moderated
Jun 26, 2014 12:36 PM in response to: geoff swartz
Re: can't run tests on spec folder

Hi,

 

it looks like the spec doesn't work if you run it from the directory RubyMine uses for this (check the run configuration's working directory).

Most likely your code is supposed to be executed from project root only and we try to run it from other directory.

 

Regards, Oleg.

Oleg Sukhodolsky JetBrains 804 posts since
Apr 4, 2012
Currently Being Moderated
Jun 26, 2014 4:36 PM in response to: geoff swartz
Re: can't run tests on spec folder

Hi,

 

does this mean that your tests work correctly in command line when you run them from "spec" directory (using spec command)?

 

Regards, Oleg.

Oleg Sukhodolsky JetBrains 804 posts since
Apr 4, 2012
Currently Being Moderated
Jun 26, 2014 5:47 PM in response to: geoff swartz
Re: can't run tests on spec folder

Hi,

 

you can either change working directory of run configuration (Run|Edit run configurations) to project's directory, or try to add some -I params so test would find files they need.

 

Regards, Oleg.

More Like This

  • Retrieving data ...