Sha256: 3d34f4de0d3dcfe127390eb47acfa328c837c9b655c485a19b0bfc7355f5d4ce

Contents?: true

Size: 877 Bytes

Versions: 21

Compression:

Stored size: 877 Bytes

Contents

require 'test/unit'
require 'openid/extras'

class StartsWithTestCase < Test::Unit::TestCase
    def test_starts_with
        [["anything", ""],
         ["something else", ""],
         ["", ""],
         ["foos", "foo"],
        ].each{|str,target| assert(str.starts_with?(target))}
    end

    def test_not_starts_with
        [["x", "y"],
         ["foos", "ball"],
         ["xx", "xy"],
        ].each{|str,target| assert(!(str.starts_with? target)) }
    end

    def test_ends_with
        [["anything", ""],
         ["something else", " else"],
         ["", ""],
         ["foos", "oos"],
        ].each{|str,target| assert(str.ends_with?(target))}
    end

    def test_not_ends_with
        [["x", "y"],
         ["foos", "ball"],
         ["xx", "xy"],
         ["foosball", "foosbal"],
        ].each{|str,target| assert(!(str.ends_with? target)) }
    end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
ruby-openid-2.6.0 test/test_extras.rb
pelle-ruby-openid-2.1.8 test/test_extras.rb
ruby-openid-2.5.0 test/test_extras.rb
ruby-openid-2.4.0 test/test_extras.rb
ruby-openid-2.3.0 test/test_extras.rb
ruby-openid-2.2.3 test/test_extras.rb
ruby-openid-2.2.2 test/test_extras.rb
ruby-openid-2.2.1 test/test_extras.rb
ruby-openid-2.2.0 test/test_extras.rb
nov-ruby-openid-2.1.9 test/test_extras.rb
ruby-openid-2.1.8 test/test_extras.rb
pelle-ruby-openid-2.1.9 test/test_extras.rb
ruby-openid-2.1.7 test/test_extras.rb
ruby-openid-2.0.1 test/test_extras.rb
ruby-openid-2.0.2 test/test_extras.rb
ruby-openid-2.1.4 test/test_extras.rb
ruby-openid-2.1.2 test/test_extras.rb
ruby-openid-2.0.3 test/test_extras.rb
ruby-openid-2.0.4 test/test_extras.rb
ruby-openid-2.1.5 test/test_extras.rb