spec/unicode_emoji_spec.rb in unicode-emoji-0.9.3 vs spec/unicode_emoji_spec.rb in unicode-emoji-1.0.0
- old
+ new
@@ -1,16 +1,16 @@
require_relative "../lib/unicode/emoji"
require "minitest/autorun"
describe Unicode::Emoji do
describe ".properties" do
- it "will return an Array with Emoji properties if codepoints has some" do
+ it "returns an Array for Emoji properties if has codepoints" do
assert_equal ["Emoji", "Emoji_Presentation"], Unicode::Emoji.properties("π΄")
assert_equal ["Emoji"], Unicode::Emoji.properties("β ")
end
- it "will return nil with Emoji properties if codepoints has some" do
+ it "returns nil for Emoji properties if has no codepoints" do
assert_nil Unicode::Emoji.properties("A")
end
end
describe "REGEX" do
@@ -22,71 +22,71 @@
it "matches singleton emoji in combination with emoji variation selector" do
"π΄\u{FE0F} sleeping face" =~ Unicode::Emoji::REGEX
assert_equal "π΄\u{FE0F}", $&
end
- it "does not match singleton emoji when in combination with text variation selector" do
+ it "does not match singleton emoji in combination with text variation selector" do
"π΄\u{FE0E} sleeping face" =~ Unicode::Emoji::REGEX
assert_nil $&
end
it "does not match textual singleton emoji" do
"βΆ play button" =~ Unicode::Emoji::REGEX
assert_nil $&
end
- it "does match textual singleton emoji in combination with emoji variation selector" do
+ it "matches textual singleton emoji in combination with emoji variation selector" do
"βΆ\u{FE0F} play button" =~ Unicode::Emoji::REGEX
assert_equal "βΆ\u{FE0F}", $&
end
it "does not match singleton 'component' emoji codepoints" do
"π» light skin tone" =~ Unicode::Emoji::REGEX
assert_nil $&
end
- it "does match modified emoji if modifier base emoji is used" do
+ it "matches modified emoji if modifier base emoji is used" do
"ππ½ person in bed: medium skin tone" =~ Unicode::Emoji::REGEX
assert_equal "ππ½", $&
end
it "does not match modified emoji if no modifier base emoji is used" do
"π΅π½ cactus" =~ Unicode::Emoji::REGEX
assert_equal "π΅", $&
end
- it "does match valid region flags" do
+ it "matches valid region flags" do
"π΅πΉ Portugal" =~ Unicode::Emoji::REGEX
assert_equal "π΅πΉ", $&
end
it "does not match invalid region flags" do
"π΅π΅ PP Land" =~ Unicode::Emoji::REGEX
assert_nil $&
end
- it "does match emoji keycap sequences" do
+ it "matches emoji keycap sequences" do
"2οΈβ£ keycap: 2" =~ Unicode::Emoji::REGEX
assert_equal "2οΈβ£", $&
end
- it "does match recommended tag sequences" do
+ it "matches recommended tag sequences" do
"π΄σ §σ ’σ ³σ £σ ΄σ Ώ Scotland" =~ Unicode::Emoji::REGEX
assert_equal "π΄σ §σ ’σ ³σ £σ ΄σ Ώ", $&
end
- it "does not match valid tag sequences which are not recommended" do
+ it "does not match valid tag sequences that are not recommended" do
"π΄σ §σ ’σ ‘σ §σ ’σ Ώ GB AGB" =~ Unicode::Emoji::REGEX
assert_equal "π΄", $& # only base flag is matched
end
- it "does match recommended zwj sequences" do
+ it "matches recommended zwj sequences" do
"π€Ύπ½ββοΈ woman playing handball: medium skin tone" =~ Unicode::Emoji::REGEX
assert_equal "π€Ύπ½ββοΈ", $&
end
- it "does not match valid zwj sequences which are not recommended" do
+ it "does not match valid zwj sequences that are not recommended" do
"π€ βπ€’ vomiting cowboy" =~ Unicode::Emoji::REGEX
assert_equal "π€ ", $&
end
end
@@ -109,66 +109,66 @@
it "does not match textual singleton emoji" do
"βΆ play button" =~ Unicode::Emoji::REGEX_VALID
assert_nil $&
end
- it "does match textual singleton emoji in combination with emoji variation selector" do
+ it "matches textual singleton emoji in combination with emoji variation selector" do
"βΆ\u{FE0F} play button" =~ Unicode::Emoji::REGEX_VALID
assert_equal "βΆ\u{FE0F}", $&
end
it "does not match singleton 'component' emoji codepoints" do
"π» light skin tone" =~ Unicode::Emoji::REGEX_VALID
assert_nil $&
end
- it "does match modified emoji if modifier base emoji is used" do
+ it "matches modified emoji if modifier base emoji is used" do
"ππ½ person in bed: medium skin tone" =~ Unicode::Emoji::REGEX_VALID
assert_equal "ππ½", $&
end
it "does not match modified emoji if no modifier base emoji is used" do
"π΅π½ cactus" =~ Unicode::Emoji::REGEX_VALID
assert_equal "π΅", $&
end
- it "does match valid region flags" do
+ it "matches valid region flags" do
"π΅πΉ Portugal" =~ Unicode::Emoji::REGEX_VALID
assert_equal "π΅πΉ", $&
end
it "does not match invalid region flags" do
"π΅π΅ PP Land" =~ Unicode::Emoji::REGEX_VALID
assert_nil $&
end
- it "does match emoji keycap sequences" do
+ it "matches emoji keycap sequences" do
"2οΈβ£ keycap: 2" =~ Unicode::Emoji::REGEX_VALID
assert_equal "2οΈβ£", $&
end
- it "does match recommended tag sequences" do
+ it "matches recommended tag sequences" do
"π΄σ §σ ’σ ³σ £σ ΄σ Ώ Scotland" =~ Unicode::Emoji::REGEX_VALID
assert_equal "π΄σ §σ ’σ ³σ £σ ΄σ Ώ", $&
end
- it "does match valid tag sequences, even though they are not recommended" do
+ it "matches valid tag sequences, even though they are not recommended" do
"π΄σ §σ ’σ ‘σ §σ ’σ Ώ GB AGB" =~ Unicode::Emoji::REGEX_VALID
assert_equal "π΄σ §σ ’σ ‘σ §σ ’σ Ώ", $&
end
it "does not match invalid tag sequences" do
"π΄σ §σ ’σ ‘σ ‘σ ‘σ Ώ GB AAA" =~ Unicode::Emoji::REGEX_VALID
assert_equal "π΄", $&
end
- it "does match recommended zwj sequences" do
+ it "matches recommended zwj sequences" do
"π€Ύπ½ββοΈ woman playing handball: medium skin tone" =~ Unicode::Emoji::REGEX_VALID
assert_equal "π€Ύπ½ββοΈ", $&
end
- it "does match valid zwj sequences, even though they are not recommended" do
+ it "matches valid zwj sequences, even though they are not recommended" do
"π€ βπ€’ vomiting cowboy" =~ Unicode::Emoji::REGEX_VALID
assert_equal "π€ βπ€’", $&
end
end
@@ -191,11 +191,11 @@
it "does not match textual singleton emoji" do
"βΆ play button" =~ Unicode::Emoji::REGEX
assert_nil $&
end
- it "does match textual singleton emoji in combination with emoji variation selector" do
+ it "matches textual singleton emoji in combination with emoji variation selector" do
"βΆ\u{FE0F} play button" =~ Unicode::Emoji::REGEX
assert_equal "βΆ\u{FE0F}", $&
end
it "does not match singleton 'component' emoji codepoints" do
@@ -238,15 +238,15 @@
it "does not match singleton emoji in combination with emoji variation selector" do
"π΄\u{FE0F} sleeping face" =~ Unicode::Emoji::REGEX_TEXT
assert_nil $&
end
- it "does match singleton emoji in combination with text variation selector" do
+ it "matches singleton emoji in combination with text variation selector" do
"π΄\u{FE0E} sleeping face" =~ Unicode::Emoji::REGEX_TEXT
assert_equal "π΄\u{FE0E}", $&
end
- it "does match textual singleton emoji" do
+ it "matches textual singleton emoji" do
"βΆ play button" =~ Unicode::Emoji::REGEX_TEXT
assert_equal "βΆ", $&
end
it "does not match textual singleton emoji in combination with emoji variation selector" do