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