Skip to content

Commit

Permalink
Merge pull request #330 from guard/e2-debugging_rbx_failures
Browse files Browse the repository at this point in the history
add details to RBX failures on Travis
  • Loading branch information
e2 committed Jun 26, 2015
2 parents 1796fda + 83bf123 commit b3e627c
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
require "rspec"

# To help produce better bug reports in Rubinius
if RUBY_ENGINE == "rbx"
$DEBUG = true # would be nice if this didn't fail ... :(
require "rspec/matchers"
require "rspec/matchers/built_in/be"
end

if ENV["CI"]
require "coveralls"
Coveralls.wear!
Expand Down Expand Up @@ -107,7 +114,16 @@ def instance_double(*args)
abort "stub me: Dir[#{args.first}]!"
end

%w(directory? delete readlines).each do |meth|
unless RUBY_ENGINE == "rbx"
# RBX uses cache in ~/.rbx
%w(directory?).each do |meth|
allow(File).to receive(meth.to_sym) do |*args|
abort "stub me: File.#{meth}(#{args.map(&:inspect) * ','})!"
end
end
end

%w(delete readlines).each do |meth|
allow(File).to receive(meth.to_sym) do |*args|
abort "stub me: File.#{meth}(#{args.map(&:inspect) * ','})!"
end
Expand All @@ -118,5 +134,11 @@ def instance_double(*args)
abort "stub me: FileUtils.#{meth}(#{args.map(&:inspect) * ','})!"
end
end

%w(spawn system).each do |meth|
allow(File).to receive(meth.to_sym) do |*args|
abort "stub me: Kernel.#{meth}(#{args.map(&:inspect) * ','})!"
end
end
end
end

0 comments on commit b3e627c

Please sign in to comment.