0

I've started to use Cucumber and wrote a simple test before the code implementation and cucumber said that minitest required. How can i require minitest in cucumber and how or in which file minitest should be required? Thanks in advance. This is my error log:

Warning: you should require 'minitest/autorun' instead.
From C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
  C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
  C:/Ruby200/lib/ruby/2.0.0/test/unit/assertions.rb:1:in `<top (required)>'
  C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
  C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
  C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.3.2/lib/cucumber/rb_support/rb_language.rb:17:in `rescue in rescue in <top (required)>'
  C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.3.2/lib/cucumber/rb_support/rb_language.rb:12:in `rescue in <top (required)>'
  C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.3.2/lib/cucumber/rb_support/rb_language.rb:9:in `<top (required)>'
  C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
  C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
  C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.3.2/lib/cucumber/cli/options.rb:3:in `<top (required)>'
  C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
  C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
  C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.3.2/lib/cucumber/cli/configuration.rb:2:in `<top (required)>'
  C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
  C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
  C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.3.2/lib/cucumber/cli/main.rb:12:in `<top (required)>'
  C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
  C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
  C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.3.2/bin/cucumber:11:in `<top (required)>'
  C:/Ruby200/bin/cucumber:23:in `load'
  C:/Ruby200/bin/cucumber:23:in `<top (required)>'
  -e:1:in `load'
  -e:1:in `<main>'
MiniTest::Unit::TestCase is now Minitest::Test. From C:/Ruby200/lib/ruby/2.0.0/test/unit/testcase.rb:8:in `<module:Unit>'
undefined method `_run_suite' for class `Test::Unit::Runner' (NameError)
C:/Ruby200/lib/ruby/2.0.0/test/unit.rb:670:in `<class:Runner>'
C:/Ruby200/lib/ruby/2.0.0/test/unit.rb:255:in `<module:Unit>'
C:/Ruby200/lib/ruby/2.0.0/test/unit.rb:9:in `<module:Test>'
C:/Ruby200/lib/ruby/2.0.0/test/unit.rb:8:in `<top (required)>'
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.3.2/lib/cucumber/core_ext/disable_mini_and_test_unit_autorun.rb:2:in `<top (required)>'
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.3.2/lib/cucumber/runtime.rb:23:in `initialize'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.3.2/lib/cucumber/cli/main.rb:44:in `new'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.3.2/lib/cucumber/cli/main.rb:44:in `execute!'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.3.2/bin/cucumber:13:in `<top (required)>'
C:/Ruby200/bin/cucumber:23:in `load'
C:/Ruby200/bin/cucumber:23:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
grek011
  • 3
  • 3
  • Without an indication of what files actually exist, how do we tell you what file things should go in. Do you have the code that provides this error? Can you show it? – vgoff Jul 05 '13 at 07:56
  • cucumber 1.3.3 fixed this problem) – grek011 Jul 16 '13 at 07:45

1 Answers1

2

The particular error you are getting was a bug in cucumber and has been fixed in the latest release of cucumber 1.3.3.

You will probably also need something like this:

require 'minitest'
module MiniTestAssertions
  def self.extended(base)
    base.extend(MiniTest::Assertions)
    base.assertions = 0
  end

  attr_accessor :assertions
end
World(MiniTestAssertions)

in your features/support/ directory.

Please see cucumber issues: #489 & 456

Tooky
  • 206
  • 1
  • 7