Permalink
Browse files

Specs for Agent#==

  • Loading branch information...
1 parent 293b09d commit 135a19d938692ef93b02c58ecd399797a19edae5 @tj committed Aug 28, 2009
Showing with 23 additions and 8 deletions.
  1. +1 −1 History.rdoc
  2. +5 −4 Manifest
  3. +1 −1 lib/user-agent/agent.rb
  4. +14 −0 spec/agent_spec.rb
  5. +2 −2 user-agent.gemspec
View
@@ -1,4 +1,4 @@
-=== 0.0.1 / YYYY-MM-DD
+=== 0.0.1 / 2009-08-28
* Initial release
View
@@ -1,14 +1,15 @@
History.rdoc
lib/user-agent/agent.rb
-lib/user-agent/map.rb
lib/user-agent/version.rb
lib/user-agent.rb
+Manifest
Rakefile
README.rdoc
-spec/GEM_spec.rb
+spec/agent_spec.rb
+spec/agents_spec.rb
+spec/spec.opts
spec/spec_helper.rb
tasks/docs.rake
tasks/gemspec.rake
tasks/spec.rake
-Todo.rdoc
-Manifest
+user-agent.gemspec
View
@@ -70,7 +70,7 @@ def inspect
# Check if the agent is the same as _other_ agent.
def == other
- self.string == other.string
+ string == other.string
end
#--
View
@@ -47,4 +47,18 @@
@agent.name.should == :'Safari'
end
end
+
+ describe "#==" do
+ it "should be equal when the user agent strings are the same" do
+ a = Agent.new 'foo'
+ b = Agent.new 'foo'
+ a.should == b
+ end
+
+ it "should not be equal when user agent strings are different" do
+ a = Agent.new 'foo'
+ b = Agent.new 'bar'
+ a.should_not == b
+ end
+ end
end
View
@@ -9,8 +9,8 @@ Gem::Specification.new do |s|
s.date = %q{2009-08-28}
s.description = %q{User agent parser}
s.email = %q{tj@vision-media.ca}
- s.extra_rdoc_files = ["lib/user-agent/agent.rb", "lib/user-agent/map.rb", "lib/user-agent/version.rb", "lib/user-agent.rb", "README.rdoc", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
- s.files = ["History.rdoc", "lib/user-agent/agent.rb", "lib/user-agent/map.rb", "lib/user-agent/version.rb", "lib/user-agent.rb", "Rakefile", "README.rdoc", "spec/GEM_spec.rb", "spec/spec_helper.rb", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake", "Todo.rdoc", "Manifest", "user-agent.gemspec"]
+ s.extra_rdoc_files = ["lib/user-agent/agent.rb", "lib/user-agent/version.rb", "lib/user-agent.rb", "README.rdoc", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake"]
+ s.files = ["History.rdoc", "lib/user-agent/agent.rb", "lib/user-agent/version.rb", "lib/user-agent.rb", "Manifest", "Rakefile", "README.rdoc", "spec/agent_spec.rb", "spec/agents_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/docs.rake", "tasks/gemspec.rake", "tasks/spec.rake", "user-agent.gemspec"]
s.homepage = %q{}
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "User-agent", "--main", "README.rdoc"]
s.require_paths = ["lib"]

0 comments on commit 135a19d

Please sign in to comment.