tst 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/tst.rb +2 -2
- data/test/assertions.rb +5 -0
- metadata +1 -1
data/Rakefile
CHANGED
data/lib/tst.rb
CHANGED
@@ -2,7 +2,7 @@ require 'tst/reporters'
|
|
2
2
|
|
3
3
|
# Tst
|
4
4
|
module Tst
|
5
|
-
VERSION = "0.0.
|
5
|
+
VERSION = "0.0.2"
|
6
6
|
|
7
7
|
# ### Failure ###
|
8
8
|
#
|
@@ -66,7 +66,7 @@ module Tst
|
|
66
66
|
begin
|
67
67
|
yield
|
68
68
|
rescue => actual
|
69
|
-
return if actual.kind_of?(expected)
|
69
|
+
return actual if actual.kind_of?(expected)
|
70
70
|
raise Failure.new("Failure: Unexpected Exception", expected, actual)
|
71
71
|
end
|
72
72
|
raise Failure.new("Failure: No Exception", expected, "Nothing raised.")
|
data/test/assertions.rb
CHANGED
@@ -59,3 +59,8 @@ end
|
|
59
59
|
tst "assert_raises does NOT raise on expected error subclass" do
|
60
60
|
assert_raises(ArgumentError) { raise Class.new(ArgumentError) }
|
61
61
|
end
|
62
|
+
|
63
|
+
tst "assert_raises returns the raised exception" do
|
64
|
+
error = assert_raises(NameError) { raise NameError.new('lkjlkjlkj') }
|
65
|
+
assert_equal 'lkjlkjlkj', error.message
|
66
|
+
end
|