1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test/ruby: better assertions

* test/ruby: use better assertions instead of mere assert.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-12-13 09:18:05 +00:00
parent 287d2adab0
commit 3ac0ec4ecd
45 changed files with 532 additions and 510 deletions

View file

@ -42,7 +42,7 @@ module Emoji
def test_encoding_name
%w(UTF8-DoCoMo
SJIS-DoCoMo).each do |n|
assert Encoding.name_list.include?(n), "encoding not found: #{n}"
assert_include Encoding.name_list, n, "encoding not found: #{n}"
end
end
@ -126,7 +126,7 @@ module Emoji
SJIS-KDDI
ISO-2022-JP-KDDI
stateless-ISO-2022-JP-KDDI).each do |n|
assert Encoding.name_list.include?(n), "encoding not found: #{n}"
assert_include Encoding.name_list, n, "encoding not found: #{n}"
end
end
@ -250,7 +250,7 @@ module Emoji
def test_encoding_name
%w(UTF8-SoftBank
SJIS-SoftBank).each do |n|
assert Encoding.name_list.include?(n), "encoding not found: #{n}"
assert_include Encoding.name_list, n, "encoding not found: #{n}"
end
end

View file

@ -122,7 +122,7 @@ EOT
def test_sym_eq
s = "aa".force_encoding("utf-16le")
assert(s.intern != :aa, "#{encdump s}.intern != :aa")
assert_not_equal(:aa, s.intern, "#{encdump s}.intern != :aa")
end
def test_compatible
@ -253,10 +253,10 @@ EOT
def test_succ
s = "\xff\xff".force_encoding("utf-16be")
assert(s.succ.valid_encoding?, "#{encdump s}.succ.valid_encoding?")
assert_predicate(s.succ, :valid_encoding?, "#{encdump s}.succ.valid_encoding?")
s = "\xdb\xff\xdf\xff".force_encoding("utf-16be")
assert(s.succ.valid_encoding?, "#{encdump s}.succ.valid_encoding?")
assert_predicate(s.succ, :valid_encoding?, "#{encdump s}.succ.valid_encoding?")
end
def test_regexp_union
@ -366,7 +366,7 @@ EOT
def test_regexp_escape
s = "\0*".force_encoding("UTF-16BE")
r = Regexp.new(Regexp.escape(s))
assert(r =~ s, "#{encdump(r)} =~ #{encdump(s)}")
assert_match(r, s, "#{encdump(r)} =~ #{encdump(s)}")
end
def test_casecmp2