lib/testrbl.rb in testrbl-0.1.14 vs lib/testrbl.rb in testrbl-0.1.15

- old
+ new

@@ -18,13 +18,13 @@ def self.run_from_cli(argv) i_test, file, line = detect_usable(argv) if file and line file = "./#{file}" if file =~ /^[a-z]/ # fix 1.9 not being able to load local files - run "#{bundle_exec}ruby #{i_test}#{file} -n '/#{pattern_from_file(File.readlines(file), line)}/'" + run "#{ruby} #{i_test}#{file} -n '/#{pattern_from_file(File.readlines(file), line)}/'" elsif file - run "#{bundle_exec}ruby #{i_test}#{file}" + run "#{ruby} #{i_test}#{file}" else # pass though # no bundle exec: projects with mini and unit-test do not run well via bundle exec testrb run "testrb #{argv.map{|a| a.include?(' ') ? "'#{a}'" : a }.join(' ')}" end end @@ -66,11 +66,15 @@ elsif File.file?(argv.first) [i_test, argv.first, false] end end - def self.bundle_exec - "bundle exec " if File.file?("Gemfile") + def self.ruby + if File.file?("Gemfile") + "ruby -rbundler/setup" # faster then bundle exec ruby + else + "ruby" + end end def self.run(command) puts command STDOUT.flush # if exec fails horribly we at least see some output