Running cucumber tests through Intelli-J 10.5.3? - ruby

When I try to run cucumber tests with Ruby 1.9.3-p0, I get this:
Cucumber gem 'cucumber(1.1.3) isn't supported by graphical test runner, please use verison >= '0.3.7' for 'RVM: ruby-1.9.3-p0' SDK
Is there any way to get around this? I'd like to be able to run and debug tests from within my IDE.

It's a known issue fixed after 10.5.3, check this bug for workarounds.

Related

require self made gem in jruby fails after update to jruby-1.7.13

I used jruby-1.7.0 and testing frame work Test::Unit::TestCase. Now I have updated some gems which caused me to use MiniTest::Test for testing, so I also upgraded to jruby-1.7.13. I have a rake task too which builds my gems with java *.class files instead of ruby *.rb files. Now many things dont work any more like 'rake test', or require "my_gem_xyz" from irb, getting errors like load error and ArrayIndexOutOfBoudsException. I have rvm installed to switch between rubies.
How can I use *.class files in my self made gems like it worked before under jruby-1.7.0? (If I include the *.rb files in the gem it seems to work ok)
Some time ago I tried with jruby-1.7.4 but that also failed with similar reasons (at that time I still used Test::Unit::TestCase, so the test frame work is not the problem)
Any ideas?
Frank
I found a surprising solution to the problem. I had compiled the *.rb classes with my jruby version 1.7.0's jrubyc. This caused the tests to fail with the load error. I had to compile all ruby classes with the jrubyc version 1.7.13 where I also build the gems.
update:
'rake test' still does not work comming up with errors like Mocha::ExpectationError: unexpected invocation: ...
what works is to use test options specifiying test file and test name (also with reg.exp.) like
rake test TEST=test/test_bla_bla.rb TESTOPTS="--name=/test_should_read/ -v"
I have the feeling the randomization with the seed parameter causes the problem. How can I influence the seed parameter?
update:
It looks like if there are too many tests in the test suite, MiniTest cannot handle this. In some cases I could run about 10 tests in some up to 35, using the TESTOPTS switch. I always fail if I run all tests in my test library with 'rake test'. This looks like a bug to me. Is there anybody who can help?

Unable to run cucumber test on intellij idea 12

I have followed all necessary steps an installed ruby and bundle.
which ruby
/Users/v-bpurkayastha/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
which gem
/Users/v-bpurkayastha/.rvm/rubies/ruby-1.9.3-p194/bin/gem
but on intellij idea while running it say
Cucumber support disabled because 'cucumber-rails' gem or Cucumber Rails plugin
are missing. Install gem and add it to the Gemfile
On run configuration it says
No cucumber gem found in sdk
even after selecting sdk.
Please help me out.
many thanks,
I have had a similar issue with my IntelliJ Idea 14 where it was incorrectly assigning the path for Gems bin directory under project settings' SDK for Ruby.
I changed it to /.rvm/gems/ruby-2.1.4/bin and when running the cucumber tests it picks it up and run the acceptance tests.
I had the same problem. When I viewed the module settings it did show the cucumber gem in the list. I clicked on the cucumber gem and clicked 'update gems'. It did find a newer version of the cucumber gem (1.3.15 instead of 1.3.14) and updated it. I was able to run my cucumber tests after that with no error.
For my version (IntelliJ 2018.3 Ultimate), since my project is consisted of java modules as well as cucumber test module (in the "test/func" folder). I had to
Set up ruby and its gem
Import the test folder as a module
Project Setting -> Modules, add a module by import existing source
Add the Ruby SDK to that module

Using "jenkins-cucumber-jvm-reports-plugin-java" with Ruby

I am using Jenkins/Hudson as my CI environment, and my tests use Cucumber-Ruby. I would like to use jenkins-cucumber-jvm-reports-plugin-java with it. Any help is much appreciated (links, pointers etc).
Cucumber-jvm is a java-based tool where as Cucumber is a Ruby-based tool. You should find a better fit for your plugin such Cucumber Test Result Plugin or Cucumber Reports Plugin.
Install rake plugin for Jenkins.
Create a rake file with cucumber options
Make cucumber to produce json output report
And you should be done. Check my similar question here
https://stackoverflow.com/questions/22492891/jenkins-rake-cucumber-json-report-empty

rcov outside rails

This may seem obvious but I don't find a way to run Rcov or coverMe outside a Rails project.
I would like to use it with Rspec 2.5
I am using Ruby 1.9.2 so I guess this may be the problem.
I also would like not to use rake tasks but a command on the command line. I have tried several things and the best result I got is Rcov report for :
/var/lib/gems/1.9.1/gems/rcov-0.9.9/lib/rcov/code_coverage_analyzer.rb
and
/var/lib/gems/1.9.1/gems/rcov-0.9.9/lib/rcov/code_coverage_analyzer.rb
No idea why
Check out http://ruby-toolbox.com/categories/code_metrics.html for some alternatives to RCov if using Ruby 1.9 is the problem.
SimpleCov, it runs awesome outside the Rails box.
http://rubydoc.info/gems/simplecov/0.5.4/frames
The latest available version of rcov (0.9.8) still doesn't have good support for 1.9.2. You can try to run it on your project by doing:
rcov spec/*.rb
But you'll most likely get something like:
** WARNING: Ruby 1.9 Support is experimental at best. Don't expect correct results! **
And then some errors after that.

cucumber debugger not stopping

I'm trying to debug a simple BDD test using cucumber. In order to do that, I inserted a debugger statement where I would like to break the control flow. But it seems that cucumber ignores this statement.
I'm running the tests executing:
rake cucumber:wip
It's rather simple, so I think the code isn' t worth pasting here. Thanks in advance
You don't have the rails-debug gem installed and/or included.
Make sure rails-debug listed in your Gemfile
If it's still not being included, make sure you run cucumber like:
bundle exec cucumber ...

Resources