Why I get No tests were found ?

Hello,

I am trying to run a test configuration that will runs all rspec tests in the rspec folder, but, I get the error "No tests were found"
If I run a test for single file inside the folder of rspec, the test will pass

In the Configuration, please see the attached pic

In my gemFile:

group :test, :development do
  gem 'turn', :require => false
  gem "rspec-rails", "~> 2.7.0"
end
I am using Windows 7, RubyMine 3.2.4

Here is the log I got: ( notice the two files found, yet, it says "No tests were found"

D:\RailsInstaller\Ruby1.9.2\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) "D:\Program Files (x86)\JetBrains\RubyMine 3.2.4\rb\testing\runner\specs_in_folder_runner.rb"
Testing started at 8:54 AM ...
Work directory: C:/Users/Sam/RubymineProjects/course_builder}
Searching files....
=========================================
1. C:/Users/Sam/RubymineProjects/course_builder/spec/models/certificate_spec.rb:1
2. C:/Users/Sam/RubymineProjects/course_builder/spec/my_example_spec.rb:1


2 files were found.
=========================================
RSpec script : D:\RailsInstaller\Ruby1.9.2\bin/rspec

Spec Options:
[]
=========================================
Running specs...
Command line:
["D:\\RailsInstaller\\Ruby1.9.2\\bin\\ruby.exe", "-e", "$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)", "D:\\RailsInstaller\\Ruby1.9.2\\bin/rspec", "--require", "teamcity/spec/runner/formatter/teamcity/formatter", "--format", "Spec::Runner::Formatter::TeamcityFormatter", "C:/Users/Sam/RubymineProjects/course_builder/spec/models/certificate_spec.rb", "C:/Users/Sam/RubymineProjects/course_builder/spec/my_example_spec.rb"]
D:\RailsInstaller\Ruby1.9.2\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) D:\RailsInstaller\Ruby1.9.2\bin/rspec --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter C:/Users/Sam/RubymineProjects/course_builder/spec/models/certificate_spec.rb C:/Users/Sam/RubymineProjects/course_builder/spec/my_example_spec.rb
D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:31:in `block in setup': You have already activated rspec-core 2.8.0.rc2, but your Gemfile requires rspec-core 2.7.1. Consider using bundle exec. (Gem::LoadError)
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:17:in `setup'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler.rb:107:in `setup'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/setup.rb:17:in `<top (required)>'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from C:/Users/Sam/RubymineProjects/course_builder/config/boot.rb:6:in `<top (required)>'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from C:/Users/Sam/RubymineProjects/course_builder/config/application.rb:1:in `<top (required)>'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from C:/Users/Sam/RubymineProjects/course_builder/config/environment.rb:2:in `<top (required)>'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from C:/Users/Sam/RubymineProjects/course_builder/spec/spec_helper.rb:3:in `<top (required)>'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from C:/Users/Sam/RubymineProjects/course_builder/spec/models/certificate_spec.rb:1:in `<top (required)>'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0.rc2/lib/rspec/core/configuration.rb:635:in `load'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0.rc2/lib/rspec/core/configuration.rb:635:in `block in load_spec_files'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0.rc2/lib/rspec/core/configuration.rb:635:in `map'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0.rc2/lib/rspec/core/configuration.rb:635:in `load_spec_files'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0.rc2/lib/rspec/core/command_line.rb:22:in `run'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0.rc2/lib/rspec/core/runner.rb:80:in `run_in_process'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0.rc2/lib/rspec/core/runner.rb:69:in `run'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0.rc2/lib/rspec/core/runner.rb:10:in `block in autorun'
D:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/rake.rb:993:in `block in sh': Command failed with status (1): [D:\RailsInstaller\Ruby1.9.2\bin\ruby.exe -...] (RuntimeError)
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/rake.rb:1008:in `call'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/rake.rb:1008:in `sh'
    from D:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/rake.rb:1092:in `sh'
    from D:/Program Files (x86)/JetBrains/RubyMine 3.2.4/rb/testing/runner/specs_in_folder_runner.rb:146:in `<top (required)>'
    from -e:1:in `load'
    from -e:1:in `<main>'
Empty test suite.

Process finished with exit code 1



Attachment(s):
config.png
3 comments

D:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:31:in `block in setup': You have already activated rspec-core 2.8.0.rc2, but your Gemfile requires rspec-core 2.7.1. Consider using bundle exec. (Gem::LoadError)

Hi,
I assume answer is written in your stacktrace. Please checkeck that bundle emulation enabled in run configuration settings,  bundler tab

0

Thanks, but, Can you please tell me where & how can I enable the bundle emulation ?

0

Open run configuration settings (Run | Edit Configurations..), select your run configuration and check settings in "bundler" tab

0

Please sign in to leave a comment.