-
Notifications
You must be signed in to change notification settings - Fork 59
Shared rspec example groups not loading #39
Description
Hey there, I'm having an issue with hydra with rspec where shared examples aren't able to be used for some reason (shared_examples_for).
It's able to load my environment and successfully run tests, but when it comes to one that uses shared examples defined in another file that was loaded on startup, it errors out.
I created a demo project that has the full stacktrace of the error that you should be able to reproduce:
RAILS_ENV=test rake hydra
https://github.com/adamfortuna/hydra-rspec-failure-demo
Here's a briefer overview:
In spec_helper.rb we load up some rspec shared examples:
Dir[File.expand_path('../support/**/*.rb', __FILE__)].each do |file|
require(file)
endshared_examples_for "a demo example" do
it "doesnt error out" do
true.should == true
end
endThen attempt to use these later on in a test:
require 'spec_helper'
describe ApplicationHelper do
it_should_behave_like "a demo example"
endWhich results in this error:
1303850302.11934 RUNNER| Running file: spec/helpers/application_helper_spec.rb
1303850302.18619 RUNNER| Could not find shared example group named "a demo example"
/Users/adam/.rvm/gems/ree-1.8.7-2010.02/gems/rspec-core-2.0.0.beta.19/lib/rspec/core/example_group.rb:65:in `it_should_behave_like': Could not find shared example group named "a demo example" (RuntimeError)
Full dump, gem versions and the rest in the repo, but it might just be a setup error on my part. I've tried this with various different rspec/hydra gem versions, but right now the demo is running 'hydra', '0.23.0' and 'rspec', '2.0.0.beta.19'. This spec can be run by itself, but errors out when run form hydra. Any ideas?