Skip to content

Commit b3e627c

Browse files
committed
Merge pull request #330 from guard/e2-debugging_rbx_failures
add details to RBX failures on Travis
2 parents 1796fda + 83bf123 commit b3e627c

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

spec/spec_helper.rb

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
require "rspec"
22

3+
# To help produce better bug reports in Rubinius
4+
if RUBY_ENGINE == "rbx"
5+
$DEBUG = true # would be nice if this didn't fail ... :(
6+
require "rspec/matchers"
7+
require "rspec/matchers/built_in/be"
8+
end
9+
310
if ENV["CI"]
411
require "coveralls"
512
Coveralls.wear!
@@ -107,7 +114,16 @@ def instance_double(*args)
107114
abort "stub me: Dir[#{args.first}]!"
108115
end
109116

110-
%w(directory? delete readlines).each do |meth|
117+
unless RUBY_ENGINE == "rbx"
118+
# RBX uses cache in ~/.rbx
119+
%w(directory?).each do |meth|
120+
allow(File).to receive(meth.to_sym) do |*args|
121+
abort "stub me: File.#{meth}(#{args.map(&:inspect) * ','})!"
122+
end
123+
end
124+
end
125+
126+
%w(delete readlines).each do |meth|
111127
allow(File).to receive(meth.to_sym) do |*args|
112128
abort "stub me: File.#{meth}(#{args.map(&:inspect) * ','})!"
113129
end
@@ -118,5 +134,11 @@ def instance_double(*args)
118134
abort "stub me: FileUtils.#{meth}(#{args.map(&:inspect) * ','})!"
119135
end
120136
end
137+
138+
%w(spawn system).each do |meth|
139+
allow(File).to receive(meth.to_sym) do |*args|
140+
abort "stub me: Kernel.#{meth}(#{args.map(&:inspect) * ','})!"
141+
end
142+
end
121143
end
122144
end

0 commit comments

Comments
 (0)