Skip to content

Commit

Permalink
Meta-testing agents
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Aug 28, 2009
1 parent 64b4a06 commit 36ffea6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions spec/agents_spec.rb
@@ -0,0 +1,21 @@

require File.dirname(__FILE__) + '/spec_helper'

describe Agent do
describe "Safari" do
[
['4.0dp1', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en) AppleWebKit/526.9 (KHTML, like Gecko) Version/4.0dp1 Safari/526.8'],
['4.0dp1', 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20081212 Mozilla/5.0 (Windows; U; Windows NT 5.1; en) AppleWebKit/526.9 (KHTML, like Gecko) Version/4.0dp1 Safari/526.8'],
['4.0.3', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9'],
['4.0.2', 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532+ (KHTML, like Gecko) Version/4.0.2 Safari/530.19.1'],
['4.0.1', 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/4.0.1 Safari/530.18'],
['4.0', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; ru-RU) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16'],
['3.2.3', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; cs-CZ) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 Safari/525.29'],
].each do |version, string|
it "should parse version '#{version}'" do
Agent.new(string).name.should == :Safari
Agent.new(string).version.should == version
end
end
end
end

0 comments on commit 36ffea6

Please sign in to comment.