Skip to content

Commit

Permalink
Started general specs
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Aug 28, 2009
1 parent 54f26dc commit d8cd074
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
29 changes: 29 additions & 0 deletions spec/agent_spec.rb
@@ -1,3 +1,32 @@

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

describe Agent do
before :each do
@agent = Agent.new 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/528.4+ (KHTML, like Gecko) Version/4.0dp1 Safari/526.11.2'
end

describe "#initialize" do
it "should allow a user agent string to be passed" do
Agent.new('foo').string.should == 'foo'
end
end

describe "#os" do
it "should return operating system symbol" do
@agent.os.should == :'OS X 10.5'
end
end

describe "#engine" do
it "should return engine symbol" do
@agent.engine.should == :webkit
end
end

describe "#version" do
it "should return engine version" do
@agent.version.should == '528.4'
end
end
end
2 changes: 2 additions & 0 deletions spec/spec.opts
@@ -0,0 +1,2 @@
--color
--format specdoc

0 comments on commit d8cd074

Please sign in to comment.