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

Don't hide LoadError exceptions raised in the spec helper #76

Merged
merged 1 commit into from
Sep 7, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions lib/turnip/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,23 @@ module RSpec
module Loader
def load(*a, &b)
if a.first.end_with?('.feature')
begin; require 'turnip_helper'; rescue LoadError; end
begin; require 'spec_helper'; rescue LoadError; end
require_if_exists 'turnip_helper'
require_if_exists 'spec_helper'

Turnip::RSpec.run(a.first)
else
super
end
end

private

def require_if_exists(filename)
require filename
rescue LoadError => e
# Don't hide LoadErrors raised in the spec helper.
raise unless e.message.include?(filename)
end
end

##
Expand Down