assure 1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assure.gemspec +1 -1
- data/test/assure_test.rb +33 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d78ae493824e62de2c3ba6a25511378475c12a2
|
4
|
+
data.tar.gz: a373df5c658af1d0fd04db3e2bb170154e61b72c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c3cd9e062040a85404f35b91001cf31d03afdc394dd70167c4acee14c93f30c2974b181770fe7f271670efb99f16f42892a06505b278b9efd94926cf65b89af
|
7
|
+
data.tar.gz: 5d2a3ed5eb075fa053ec80e9f235e069af00ae01e4b337fa07dd3da88cb35f9b9f0c4b377c5ed98a51b7dc9cb5e1f2912e0394bc657b1927ac70b4a45ce2a97b
|
data/assure.gemspec
CHANGED
data/test/assure_test.rb
CHANGED
@@ -5,29 +5,57 @@ require 'assure'
|
|
5
5
|
|
6
6
|
class AssureTest < Test::Unit::TestCase
|
7
7
|
|
8
|
-
def
|
8
|
+
def test_basic_ruby_1_8
|
9
|
+
return if RUBY_VERSION >= "1.9.0"
|
10
|
+
|
11
|
+
assure("Test".is_a? String)
|
12
|
+
|
13
|
+
exception = assert_raise(RuntimeError) do
|
14
|
+
assure(false)
|
15
|
+
end
|
16
|
+
assert_equal 'test/assure_test.rb:14: test_basic_ruby_1_8: Assertion "false" failed', exception.message
|
17
|
+
|
18
|
+
exception = assert_raise(RuntimeError) do
|
19
|
+
assure(nil)
|
20
|
+
end
|
21
|
+
assert_equal 'test/assure_test.rb:19: test_basic_ruby_1_8: Assertion "nil" failed', exception.message
|
22
|
+
|
23
|
+
exception = assert_raise(RuntimeError) do
|
24
|
+
x = 2
|
25
|
+
assure( x == 3, "#{x} == 2" )
|
26
|
+
end
|
27
|
+
assert_equal "test/assure_test.rb:25: test_basic_ruby_1_8: Assertion \"x == 3, \"\#{x} == 2\"\" failed\n2 == 2", exception.message
|
28
|
+
|
29
|
+
exception = assert_raise(RuntimeError) do
|
30
|
+
assure(1.is_a? String)
|
31
|
+
end
|
32
|
+
assert_equal 'test/assure_test.rb:30: test_basic_ruby_1_8: Assertion "1.is_a? String" failed', exception.message
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_basic_ruby_1_9_and_later
|
36
|
+
return if RUBY_VERSION < "1.9.0"
|
9
37
|
assure("Test".is_a? String)
|
10
38
|
|
11
39
|
exception = assert_raise(RuntimeError) do
|
12
40
|
assure(false)
|
13
41
|
end
|
14
|
-
assert_equal '/test/assure_test.rb:
|
42
|
+
assert_equal '/test/assure_test.rb:40: block in test_basic_ruby_1_9_and_later: Assertion "false" failed', exception.message
|
15
43
|
|
16
44
|
exception = assert_raise(RuntimeError) do
|
17
45
|
assure(nil)
|
18
46
|
end
|
19
|
-
assert_equal '/test/assure_test.rb:
|
47
|
+
assert_equal '/test/assure_test.rb:45: block in test_basic_ruby_1_9_and_later: Assertion "nil" failed', exception.message
|
20
48
|
|
21
49
|
exception = assert_raise(RuntimeError) do
|
22
50
|
x = 2
|
23
51
|
assure( x == 3, "#{x} == 2" )
|
24
52
|
end
|
25
|
-
assert_equal "/test/assure_test.rb:
|
53
|
+
assert_equal "/test/assure_test.rb:51: block in test_basic_ruby_1_9_and_later: Assertion \"x == 3, \"\#{x} == 2\"\" failed\n2 == 2", exception.message
|
26
54
|
|
27
55
|
exception = assert_raise(RuntimeError) do
|
28
56
|
assure(1.is_a? String)
|
29
57
|
end
|
30
|
-
assert_equal '/test/assure_test.rb:
|
58
|
+
assert_equal '/test/assure_test.rb:56: block in test_basic_ruby_1_9_and_later: Assertion "1.is_a? String" failed', exception.message
|
31
59
|
end
|
32
60
|
|
33
61
|
end
|