minitest 2.11.2 → 2.11.3

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,10 @@
1
+ === 2.11.3 / 2012-02-29
2
+
3
+ * 2 bug fixes:
4
+
5
+ * Clarified that assert_raises returns the exception for further testing
6
+ * Fixed assert_in_epsilon when both args are negative. (tamc)
7
+
1
8
  === 2.11.2 / 2012-02-14
2
9
 
3
10
  * 1 minor enhancement:
data/README.txt CHANGED
@@ -14,7 +14,7 @@ TDD, BDD, mocking, and benchmarking.
14
14
  paired up and we cracked open the code for a few test
15
15
  frameworks...
16
16
 
17
- I MUST say that mintiest is *very* readable / understandable
17
+ I MUST say that minitest is *very* readable / understandable
18
18
  compared to the 'other two' options we looked at. Nicely done and
19
19
  thank you for helping us keep our mental sanity."
20
20
 
@@ -233,7 +233,7 @@ module MiniTest
233
233
  # error less than +epsilon+.
234
234
 
235
235
  def assert_in_epsilon a, b, epsilon = 0.001, msg = nil
236
- assert_in_delta a, b, [a, b].min * epsilon, msg
236
+ assert_in_delta a, b, [a.abs, b.abs].min * epsilon, msg
237
237
  end
238
238
 
239
239
  ##
@@ -330,7 +330,8 @@ module MiniTest
330
330
  end
331
331
 
332
332
  ##
333
- # Fails unless the block raises one of +exp+
333
+ # Fails unless the block raises one of +exp+. Returns the
334
+ # exception matched so you can check the message, attributes, etc.
334
335
 
335
336
  def assert_raises *exp
336
337
  msg = "#{exp.pop}.\n" if String === exp.last
@@ -643,7 +644,7 @@ module MiniTest
643
644
  end
644
645
 
645
646
  class Unit # :nodoc:
646
- VERSION = "2.11.2" # :nodoc:
647
+ VERSION = "2.11.3" # :nodoc:
647
648
 
648
649
  attr_accessor :report, :failures, :errors, :skips # :nodoc:
649
650
  attr_accessor :test_count, :assertion_count # :nodoc:
@@ -661,6 +661,8 @@ Finished tests in 0.00
661
661
  end
662
662
 
663
663
  class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
664
+ RUBY18 = ! defined? Encoding
665
+
664
666
  def setup
665
667
  super
666
668
 
@@ -847,7 +849,7 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
847
849
  end
848
850
 
849
851
  def test_assert_in_epsilon
850
- @assertion_count = 8
852
+ @assertion_count = 10
851
853
 
852
854
  @tc.assert_in_epsilon 10000, 9991
853
855
  @tc.assert_in_epsilon 9991, 10000
@@ -858,6 +860,9 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
858
860
  @tc.assert_in_epsilon 9999.1, 10000, 0.0001
859
861
  @tc.assert_in_epsilon 1.0, 1.0001, 0.0001
860
862
  @tc.assert_in_epsilon 1.0001, 1.0, 0.0001
863
+
864
+ @tc.assert_in_epsilon(-1, -1)
865
+ @tc.assert_in_epsilon(-10000, -9991)
861
866
  end
862
867
 
863
868
  def test_assert_in_epsilon_triggered
@@ -866,6 +871,13 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
866
871
  end
867
872
  end
868
873
 
874
+ def test_assert_in_epsilon_triggered_negative_case
875
+ x = RUBY18 ? "0.1" : "0.10000000000000009"
876
+ util_assert_triggered "Expected |-1.1 - -1| (#{x}) to be < 0.1." do
877
+ @tc.assert_in_epsilon(-1.1, -1, 0.1)
878
+ end
879
+ end
880
+
869
881
  def test_assert_includes
870
882
  @assertion_count = 2
871
883
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest
3
3
  version: !ruby/object:Gem::Version
4
- hash: 39
4
+ hash: 37
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 11
9
- - 2
10
- version: 2.11.2
9
+ - 3
10
+ version: 2.11.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
@@ -36,7 +36,7 @@ cert_chain:
36
36
  FBHgymkyj/AOSqKRIpXPhjC6
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2012-02-15 00:00:00 Z
39
+ date: 2012-03-01 00:00:00 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rdoc
@@ -61,11 +61,11 @@ dependencies:
61
61
  requirements:
62
62
  - - ~>
63
63
  - !ruby/object:Gem::Version
64
- hash: 25
64
+ hash: 29
65
65
  segments:
66
66
  - 2
67
- - 13
68
- version: "2.13"
67
+ - 15
68
+ version: "2.15"
69
69
  type: :development
70
70
  version_requirements: *id002
71
71
  description: |-
@@ -77,7 +77,7 @@ description: |-
77
77
  paired up and we cracked open the code for a few test
78
78
  frameworks...
79
79
 
80
- I MUST say that mintiest is *very* readable / understandable
80
+ I MUST say that minitest is *very* readable / understandable
81
81
  compared to the 'other two' options we looked at. Nicely done and
82
82
  thank you for helping us keep our mental sanity."
83
83
 
metadata.gz.sig CHANGED
Binary file