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

Shared Examples #10

Open
garrettheaver opened this issue Jun 27, 2012 · 3 comments
Open

Shared Examples #10

garrettheaver opened this issue Jun 27, 2012 · 3 comments

Comments

@garrettheaver
Copy link
Contributor

Whilst it seems to load the shared examples fine on the first pass, subsequent runs it completely loses track of for some reason and throws a big exception stack ala :

stty: stdin isn't a terminal
stty: stdin isn't a terminal
stty: stdin isn't a terminal
stty: stdin isn't a terminal
stty: stdin isn't a terminal
...
ERROR: Guard::JRubyRSpec failed to achieve its <run_on_changes>, exception was:
ArgumentError: Could not find shared examples "a store"
/Users/garrett/.rvm/gems/jruby-1.6.7/gems/rspec-core-2.10.1/lib/rspec/core/example_group.rb:123:in find_and_eval_shared' /Users/garrett/.rvm/gems/jruby-1.6.7/gems/rspec-core-2.10.1/lib/rspec/core/example_group.rb:93:init_behaves_like'
org/jruby/RubyModule.java:2277:in module_eval' /Users/garrett/.rvm/gems/jruby-1.6.7/gems/rspec-core-2.10.1/lib/rspec/core/example_group.rb:201:insubclass'
/Users/garrett/.rvm/gems/jruby-1.6.7/gems/rspec-core-2.10.1/lib/rspec/core/example_group.rb:186:in describe' /Users/garrett/.rvm/gems/jruby-1.6.7/gems/rspec-core-2.10.1/lib/rspec/core/example_group.rb:92:init_behaves_like'
...
org/jruby/RubyModule.java:2277:in module_eval' /Users/garrett/.rvm/gems/jruby-1.6.7/gems/rspec-core-2.10.1/lib/rspec/core/example_group.rb:201:insubclass'
/Users/garrett/.rvm/gems/jruby-1.6.7/gems/rspec-core-2.10.1/lib/rspec/core/example_group.rb:186:in describe' /Users/garrett/.rvm/gems/jruby-1.6.7/gems/rspec-core-2.10.1/lib/rspec/core/dsl.rb:18:indescribe'
...
org/jruby/RubyKernel.java:1068:in load' ... org/jruby/RubyArray.java:2339:incollect'
/Users/garrett/.rvm/gems/jruby-1.6.7/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in load_spec_files' /Users/garrett/.rvm/gems/jruby-1.6.7/gems/rspec-core-2.10.1/lib/rspec/core/command_line.rb:22:inrun'
/Users/garrett/.rvm/gems/jruby-1.6.7/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:69:in run' /Users/garrett/.rvm/gems/jruby-1.6.7/bundler/gems/guard-jruby-rspec-0077eb119b88/lib/guard/jruby-rspec/runner.rb:46:inrun'
/Users/garrett/.rvm/gems/jruby-1.6.7/gems/guard-rspec-1.0.1/lib/guard/rspec.rb:49:in run_on_changes' org/jruby/RubyBasicObject.java:1704:insend'
org/jruby/RubyKernel.java:2101:in `send'

@jkutner
Copy link
Owner

jkutner commented Jun 28, 2012

I'm not sure about the error, yet. But the stty: stdin isn't a terminal can be fixed by adding this to your Guardfile

interactor :simple

The default interactor doesn't play will with JRuby.

@garrettheaver
Copy link
Contributor Author

thanks for the heads up on that one. I'd really love to get guard working at some acceptable pace on jruby though, it's pathetically slow running rspec-guard which appears to spin off about 4 separate processes each of which takes the order of 10 seconds of cpu time to complete on each run. I've had to stop using guard on jruby altogether and just manually run rspec intermittently

@garrettheaver
Copy link
Contributor Author

Just following up here with some more information as I dig. In my case it was failing as it couldn't find the shared examples in the second run. I looked through the jruby-rspec source and see you're using load p to reload the file under test which makes total sense.

In my case however that file it's (re)loading has a require to pull in the shared examples from another file and this presumably wasn't being executed (so the shared group no longer existed in the context of the new load I surmise). I've changed it from require shared_examples to load shared_examples.rb and the problem is solved. It's a curious issue.

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

No branches or pull requests

2 participants