Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lib/j_unit.rb to be able to omit the require 'yarjuf' statements #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bsingr
Copy link

@bsingr bsingr commented May 18, 2013

Without this I had to do rspec -r yarjuf -f JUnit or bundle exec rspec -f JUnit to load yarjuf before rspec was loaded. Otherwiese (e.g. putting require 'yarjuf'in a spec_helper.rb) errors like this were raised:

dpree@pinguin ~/dev/test 1.9.3-p327 master $ rspec -f JUnit
/Users/dpree/.rbfu/versions/1.9.3-p327/lib/ruby/gems/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:1021:in `require': cannot load such file -- j_unit (LoadError)
from /Users/dpree/.rbfu/versions/1.9.3-p327/lib/ruby/gems/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:1021:in `rescue in custom_formatter'
from /Users/dpree/.rbfu/versions/1.9.3-p327/lib/ruby/gems/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:1018:in `custom_formatter'
from /Users/dpree/.rbfu/versions/1.9.3-p327/lib/ruby/gems/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:507:in `add_formatter'
from /Users/dpree/.rbfu/versions/1.9.3-p327/lib/ruby/gems/gems/rspec-core-2.13.1/lib/rspec/core/configuration_options.rb:30:in `block in configure'
from /Users/dpree/.rbfu/versions/1.9.3-p327/lib/ruby/gems/gems/rspec-core-2.13.1/lib/rspec/core/configuration_options.rb:30:in `each'
from /Users/dpree/.rbfu/versions/1.9.3-p327/lib/ruby/gems/gems/rspec-core-2.13.1/lib/rspec/core/configuration_options.rb:30:in `configure'
from /Users/dpree/.rbfu/versions/1.9.3-p327/lib/ruby/gems/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:21:in `run'
from /Users/dpree/.rbfu/versions/1.9.3-p327/lib/ruby/gems/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80:in `run'
from /Users/dpree/.rbfu/versions/1.9.3-p327/lib/ruby/gems/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17:in `block in autorun'

After the change I made you can just do rspec -f JUnit without doing any pre-require statements.

@natritmeyer
Copy link
Owner

@dpree Could you change the tests so they pass? At the moment they all fail...

@bsingr
Copy link
Author

bsingr commented May 24, 2013

@natritmeyer sorry, wasn't aware of the ./features directory.

with my latest fix all tests pass (cucumber + rspec) at least for me. can u confirm?

@natritmeyer
Copy link
Owner

@dpree the tests are still requiring the yarjuf gem before rspec has loaded. See here for an example:

When I run `rspec spec/basic_spec.rb -r ../../lib/yarjuf -f JUnit`

As it stands, the tests are executing the following:
rspec spec/basic_spec.rb -r ../../lib/yarjuf -f JUnit

...but in order to test yarjuf without loading it before rspec (the purpose of your pull request - and an awesome change it would be!) the tests need to be executing the following:
rspec spec/basic_spec.rb -f JUnit

However, having tried the code in this pull request without "-r ../../lib/yarjuf" and also having added a spec_helper.rb file that contains require "yarjuf", I can't get the tests to work. What I get is this:

  Scenario: Requiring Yarjuf                       # features/basic.feature:24
    When I run `rspec spec/basic_spec.rb -f JUnit` # aruba-0.5.3/lib/aruba/cucumber.rb:60
    Then the exit status should be 0               # aruba-0.5.3/lib/aruba/cucumber.rb:154
      Exit status was 1 but expected it to be 0. Output:

      /Users/nat/.rvm/gems/ruby-1.9.3-p194@yarjuf/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:1021:in `require': cannot load such file -- j_unit (LoadError)
        from /Users/nat/.rvm/gems/ruby-1.9.3-p194@yarjuf/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:1021:in `rescue in custom_formatter'
        from /Users/nat/.rvm/gems/ruby-1.9.3-p194@yarjuf/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:1018:in `custom_formatter'
        from /Users/nat/.rvm/gems/ruby-1.9.3-p194@yarjuf/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:507:in `add_formatter'
        from /Users/nat/.rvm/gems/ruby-1.9.3-p194@yarjuf/gems/rspec-core-2.13.1/lib/rspec/core/configuration_options.rb:30:in `block in configure'
        from /Users/nat/.rvm/gems/ruby-1.9.3-p194@yarjuf/gems/rspec-core-2.13.1/lib/rspec/core/configuration_options.rb:30:in `each'
        from /Users/nat/.rvm/gems/ruby-1.9.3-p194@yarjuf/gems/rspec-core-2.13.1/lib/rspec/core/configuration_options.rb:30:in `configure'
        from /Users/nat/.rvm/gems/ruby-1.9.3-p194@yarjuf/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:21:in `run'
        from /Users/nat/.rvm/gems/ruby-1.9.3-p194@yarjuf/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80:in `run'
        from /Users/nat/.rvm/gems/ruby-1.9.3-p194@yarjuf/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17:in `block in autorun'

       (RSpec::Expectations::ExpectationNotMetError)
      features/basic.feature:26:in `Then the exit status should be 0'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants