Sha256: 415839624a8ed9b6cf1edcd90671b9c2044acc37462d1f9e9369bc5a026eb7b2
Contents?: true
Size: 1.07 KB
Versions: 2
Compression:
Stored size: 1.07 KB
Contents
require 'helper' class TestUserAgents < Test::Unit::TestCase context "Rack::Schmobile::UserAgents" do context "#remove_user_agent_pattern" do should "allow removal of a user agent" do assert Rack::Schmobile::UserAgents.is_mobile_agent?("novarra") Rack::Schmobile::UserAgents.remove_user_agent_pattern("novarra") assert !Rack::Schmobile::UserAgents.is_mobile_agent?("novarra") end end context "#add_user_agent_pattern" do should "allow adding a user agent" do assert !Rack::Schmobile::UserAgents.is_mobile_agent?("wibble") Rack::Schmobile::UserAgents.add_user_agent_pattern("wibble") assert Rack::Schmobile::UserAgents.is_mobile_agent?("wibble") end end context "#is_mobile_agent?" do should "return false for common browsers" do [ :msie6, :msie8, :opera, :chrome ].each do |browser| agent = self.send(browser) assert !Rack::Schmobile::UserAgents.is_mobile_agent?(agent), "#{browser} should not detect as mobile, #{agent}" end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
schmobile-0.4.0 | test/test_user_agents.rb |
schmobile-0.3.2 | test/test_user_agents.rb |