File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 11require "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+
310if 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
122144end
You can’t perform that action at this time.
0 commit comments