Permalink
Browse files

Pick up sibling mspec when running a spec with 'ruby' directly

  • Loading branch information...
eregon committed Nov 4, 2017
1 parent 214791f commit 2ab4d54a5971dd3b7774ba023d9d9566916856d4
Showing with 4 additions and 1 deletion.
  1. +4 −1 spec_helper.rb
View
@@ -16,11 +16,14 @@ def report_on_exception=(value)
# Running directly with ruby some_spec.rb
unless ENV['MSPEC_RUNNER']
mspec_lib = File.expand_path("../../mspec/lib", __FILE__)
$LOAD_PATH << mspec_lib if File.directory?(mspec_lib)
begin
require 'mspec'
require 'mspec/commands/mspec-run'
rescue LoadError
puts "Please add -Ipath/to/mspec/lib or install the MSpec gem to run the specs."
puts "Please add -Ipath/to/mspec/lib or clone mspec as a sibling to run the specs."
exit 1
end

0 comments on commit 2ab4d54

Please sign in to comment.