assure 1.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/assure.gemspec +1 -1
  3. data/test/assure_test.rb +33 -5
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2bdf5d2ea930c58efd2b33e79f6d66d99b946f0a
4
- data.tar.gz: a35bd195a1a202866bba0847918aa5e9247b56db
3
+ metadata.gz: 1d78ae493824e62de2c3ba6a25511378475c12a2
4
+ data.tar.gz: a373df5c658af1d0fd04db3e2bb170154e61b72c
5
5
  SHA512:
6
- metadata.gz: 250e7e08f93e2a27f923fa5b8662857a376d8c9e870b578009feb9489ebb82465c6ce2cbdd5c762e2bc666ae5e2f03cf19cb7cc61cea0dc5e49dc77de3f9fd04
7
- data.tar.gz: a3191a61a5000c8d94548f0d3d7fc15fab14ab21ffb7eaa88f6ac7a36fcdac4fa67c398778671acee87ad4b1da3fcbd16d32686be865498651323e9342bd6bb5
6
+ metadata.gz: 8c3cd9e062040a85404f35b91001cf31d03afdc394dd70167c4acee14c93f30c2974b181770fe7f271670efb99f16f42892a06505b278b9efd94926cf65b89af
7
+ data.tar.gz: 5d2a3ed5eb075fa053ec80e9f235e069af00ae01e4b337fa07dd3da88cb35f9b9f0c4b377c5ed98a51b7dc9cb5e1f2912e0394bc657b1927ac70b4a45ce2a97b
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  SPEC = Gem::Specification.new do |s|
4
4
  s.name = "assure"
5
- s.version = "1.0"
5
+ s.version = "1.0.1"
6
6
  s.author = "Pluron, Inc."
7
7
  s.email = "support@pluron.com"
8
8
  s.homepage = "http://github.com/acunote/assure"
@@ -5,29 +5,57 @@ require 'assure'
5
5
 
6
6
  class AssureTest < Test::Unit::TestCase
7
7
 
8
- def test_basic
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:12: block in test_basic: Assertion "false" failed', exception.message
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:17: block in test_basic: Assertion "nil" failed', exception.message
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:23: block in test_basic: Assertion \"x == 3, \"\#{x} == 2\"\" failed\n2 == 2", exception.message
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:28: block in test_basic: Assertion "1.is_a? String" failed', exception.message
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assure
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pluron, Inc.