test/test_validation.rb in textmagic-0.6.0 vs test/test_validation.rb in textmagic-0.7.0

- old
+ new

@@ -73,15 +73,15 @@ end describe "validate_phones method" do it "should return true if phone number consists of up to 15 digits" do - assert_equal true, TextMagic::API.validate_phones(rand(10 ** 15).to_s) + assert_equal true, TextMagic::API.validate_phones(rand(10**15).to_s) end it "should return false if phone number is longer than 15 digits" do - assert_equal false, TextMagic::API.validate_phones((10 ** 16 + rand(10 ** 15)).to_s) + assert_equal false, TextMagic::API.validate_phones((10**16 + rand(10**15)).to_s) end it "should return false if phone number contains non-digits" do assert_equal false, TextMagic::API.validate_phones(random_string) end @@ -89,20 +89,21 @@ it "should return false if phone number is empty" do assert_equal false, TextMagic::API.validate_phones("") end it "should return true if all phone numbers in a list are valid" do - phone1, phone2 = rand(10 ** 15).to_s, rand(10 ** 15).to_s + phone1 = rand(10**15).to_s + phone2 = rand(10**15).to_s assert_equal true, TextMagic::API.validate_phones(phone1, phone2) assert_equal true, TextMagic::API.validate_phones([phone1, phone2]) end it "should return false if phone numbers list is empty" do assert_equal false, TextMagic::API.validate_phones end it "should return false if format of any of phone numbers in a list is invalid" do - phone1 = rand(10 ** 15).to_s, rand(10 ** 15).to_s + phone1 = rand(10**15).to_s, rand(10**15).to_s phone2 = random_string assert_equal false, TextMagic::API.validate_phones(phone1, phone2) assert_equal false, TextMagic::API.validate_phones([phone1, phone2]) end end