Skip to content

Commit

Permalink
* Reverts r21598 and r21599 because the original behavior is
Browse files Browse the repository at this point in the history
  intentional.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
yugui committed Jan 20, 2009
1 parent b1d012a commit 8401da7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 25 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Tue Jan 20 17:59:52 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>

* Reverts r21598 and r21599 because the original behavior is
intentional.

Tue Jan 20 09:26:05 2009 NAKAMURA Usaku <usa@ruby-lang.org>

* ext/nkf/nkf-utf8/nkf.c (nkf_buf_push): maybe a bug.
Expand Down
6 changes: 0 additions & 6 deletions lib/minitest/unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def assert_block msg = nil
def assert_empty obj, msg = nil
msg = message(msg) { "Expected #{obj.inspect} to be empty" }
assert_respond_to obj, :empty?
self._assertions -= 1
assert obj.empty?, msg
end

Expand All @@ -98,7 +97,6 @@ def assert_in_epsilon a, b, epsilon = 0.001, msg = nil
def assert_includes collection, obj, msg = nil
msg = message(msg) { "Expected #{mu_pp(collection)} to include #{mu_pp(obj)}" }
assert_respond_to collection, :include?
self._assertions -= 1
assert collection.include?(obj), msg
end

Expand All @@ -120,7 +118,6 @@ def assert_kind_of cls, obj, msg = nil # TODO: merge with instance_of
def assert_match exp, act, msg = nil
msg = message(msg) { "Expected #{mu_pp(exp)} to match #{mu_pp(act)}" }
assert_respond_to act, :"=~"
self._assertions -= 1
exp = /#{Regexp.escape(exp)}/ if String === exp && String === act
assert exp =~ act, msg
end
Expand Down Expand Up @@ -244,7 +241,6 @@ def refute test, msg = nil
def refute_empty obj, msg = nil
msg = message(msg) { "Expected #{obj.inspect} to not be empty" }
assert_respond_to obj, :empty?
self._assertions -= 1
refute obj.empty?, msg
end

Expand All @@ -266,7 +262,6 @@ def refute_in_epsilon a, b, epsilon = 0.001, msg = nil
def refute_includes collection, obj, msg = nil
msg = message(msg) { "Expected #{mu_pp(collection)} to not include #{mu_pp(obj)}" }
assert_respond_to collection, :include?
self._assertions -= 1
refute collection.include?(obj), msg
end

Expand All @@ -287,7 +282,6 @@ def refute_kind_of cls, obj, msg = nil # TODO: merge with instance_of
def refute_match exp, act, msg = nil
msg = message(msg) { "Expected #{mu_pp(exp)} to not match #{mu_pp(act)}" }
assert_respond_to act, :"=~"
self._assertions -= 1
exp = /#{Regexp.escape(exp)}/ if String === exp && String === act
refute exp =~ act, msg
end
Expand Down
4 changes: 2 additions & 2 deletions test/minitest/test_mini_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
end

it "needs to verify regexp matches" do
@assertion_count = 4
@assertion_count = 6

"blah".must_match(/\w+/).must_equal true
proc { "blah".must_match(/\d+/) }.must_raise MiniTest::Assertion
Expand Down Expand Up @@ -140,7 +140,7 @@
end

it "needs to verify mismatch" do
@assertion_count = 4
@assertion_count = 6
"blah".wont_match(/\d+/).must_equal false
proc { "blah".wont_match(/\w+/) }.must_raise MiniTest::Assertion
end
Expand Down
34 changes: 17 additions & 17 deletions test/minitest/test_mini_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,13 @@ def test_assert_block_triggered
end

def test_assert_empty
@assertion_count = 1
@assertion_count = 2

@tc.assert_empty []
end

def test_assert_empty_triggered
@assertion_count = 1
@assertion_count = 2

util_assert_triggered "Expected [1] to be empty." do
@tc.assert_empty [1]
Expand Down Expand Up @@ -494,13 +494,13 @@ def test_assert_in_epsilon_triggered
end

def test_assert_includes
@assertion_count = 1
@assertion_count = 2

@tc.assert_includes [true], true
end

def test_assert_includes_triggered
@assertion_count = 2
@assertion_count = 3

e = @tc.assert_raises MiniTest::Assertion do
@tc.assert_includes [true], false
Expand Down Expand Up @@ -531,12 +531,12 @@ def test_assert_kind_of_triggered
end

def test_assert_match
@assertion_count = 1
@assertion_count = 2
@tc.assert_match(/\w+/, "blah blah blah")
end

def test_assert_match_object
@assertion_count = 1
@assertion_count = 2

pattern = Object.new
def pattern.=~(other) true end
Expand All @@ -545,7 +545,7 @@ def pattern.=~(other) true end
end

def test_assert_match_object_triggered
@assertion_count = 1
@assertion_count = 2

pattern = Object.new
def pattern.=~(other) false end
Expand All @@ -557,7 +557,7 @@ def pattern.inspect; "<<Object>>" end
end

def test_assert_match_triggered
@assertion_count = 1
@assertion_count = 2
util_assert_triggered 'Expected /\d+/ to match "blah blah blah".' do
@tc.assert_match(/\d+/, "blah blah blah")
end
Expand Down Expand Up @@ -801,13 +801,13 @@ def test_refute
end

def test_refute_empty
@assertion_count = 1
@assertion_count = 2

@tc.refute_empty [1]
end

def test_refute_empty_triggered
@assertion_count = 1
@assertion_count = 2

util_assert_triggered "Expected [] to not be empty." do
@tc.refute_empty []
Expand Down Expand Up @@ -846,13 +846,13 @@ def test_refute_in_epsilon_triggered
end

def test_refute_includes
@assertion_count = 1
@assertion_count = 2

@tc.refute_includes [true], false
end

def test_refute_includes_triggered
@assertion_count = 2
@assertion_count = 3

e = @tc.assert_raises MiniTest::Assertion do
@tc.refute_includes [true], true
Expand Down Expand Up @@ -883,17 +883,17 @@ def test_refute_kind_of_triggered
end

def test_refute_match
@assertion_count = 1
@assertion_count = 2
@tc.refute_match(/\d+/, "blah blah blah")
end

def test_refute_match_object
@assertion_count = 1
@assertion_count = 2
@tc.refute_match Object.new, 5 # default #=~ returns false
end

def test_assert_object_triggered
@assertion_count = 1
@assertion_count = 2

pattern = Object.new
def pattern.=~(other) false end
Expand All @@ -905,7 +905,7 @@ def pattern.inspect; "<<Object>>" end
end

def test_refute_match_object_triggered
@assertion_count = 1
@assertion_count = 2

pattern = Object.new
def pattern.=~(other) true end
Expand All @@ -917,7 +917,7 @@ def pattern.inspect; "<<Object>>" end
end

def test_refute_match_triggered
@assertion_count = 1
@assertion_count = 2
util_assert_triggered 'Expected /\w+/ to not match "blah blah blah".' do
@tc.refute_match(/\w+/, "blah blah blah")
end
Expand Down

0 comments on commit 8401da7

Please sign in to comment.