summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-30 06:57:34 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-30 06:57:34 +0000
commitb06f8f299fb8ebb641163c071bba652afeed53f5 (patch)
tree3eb1c9635cadbfef6795cca97d0396572c2e9627 /lib
parent421d64a63a5b11994589277a46e99cbf680bf7e6 (diff)
downloadruby-b06f8f299fb8ebb641163c071bba652afeed53f5.tar.gz
ruby-b06f8f299fb8ebb641163c071bba652afeed53f5.tar.xz
ruby-b06f8f299fb8ebb641163c071bba652afeed53f5.zip
Updated miniunit to 4257. This cleans all my tests when run in isolation. I still have failures when run with everything else
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mini/mock.rb6
-rw-r--r--lib/mini/test.rb14
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/mini/mock.rb b/lib/mini/mock.rb
index 727612540..1b79146cb 100644
--- a/lib/mini/mock.rb
+++ b/lib/mini/mock.rb
@@ -17,9 +17,9 @@ class Mini::Mock
def expect(name, retval, args=[])
n, r, a = name, retval, args # for the closure below
@expected_calls[name] = { :retval => retval, :args => args }
- self.class.__send__(:define_method, name) { |*a|
- raise ArgumentError unless @expected_calls[n][:args].size == a.size
- @actual_calls[n] << { :retval => r, :args => a }
+ self.class.__send__(:define_method, name) { |*x|
+ raise ArgumentError unless @expected_calls[n][:args].size == x.size
+ @actual_calls[n] << { :retval => r, :args => x }
retval
}
self
diff --git a/lib/mini/test.rb b/lib/mini/test.rb
index 1d76b4097..35a8df4a3 100644
--- a/lib/mini/test.rb
+++ b/lib/mini/test.rb
@@ -14,13 +14,15 @@ module Mini
class Assertion < Exception; end
class Skip < Assertion; end
- file = if __FILE__ =~ /^[^\.]/ then # OMG ruby 1.9 is so lame (rubinius too)
+ file = if RUBY_VERSION =~ /^1\.9/ then # bt's expanded, but __FILE__ isn't :(
+ File.expand_path __FILE__
+ elsif __FILE__ =~ /^[^\.]/ then # assume both relative
require 'pathname'
- pwd = Pathname.new(Dir.pwd)
- pn = Pathname.new(File.expand_path(__FILE__))
+ pwd = Pathname.new Dir.pwd
+ pn = Pathname.new File.expand_path(__FILE__)
pn = File.join(".", pn.relative_path_from(pwd)) unless pn.relative?
pn.to_s
- else
+ else # assume both are expanded
__FILE__
end
@@ -36,10 +38,8 @@ module Mini
new_bt << line
end
- new_bt = bt.reject { |line| line.rindex(MINI_DIR, 0) } if
- new_bt.empty?
+ new_bt = bt.reject { |line| line.rindex(MINI_DIR, 0) } if new_bt.empty?
new_bt = bt.dup if new_bt.empty?
-
new_bt
end