Skip to content

Commit

Permalink
Rename default user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Oct 18, 2010
1 parent 9ad0ef0 commit 2929e53
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/twitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def user_agent=(value)
end

def default_user_agent
@default_user_agent ||= 'Ruby Twitter Gem'
@default_user_agent ||= 'Twitter Ruby Gem'
end
end

Expand Down
6 changes: 3 additions & 3 deletions test/twitter/search_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ class SearchTest < Test::Unit::TestCase
assert Twitter::Search.new('httparty').query[:q].include? 'httparty'
end

should "default user agent to Ruby Twitter Gem" do
assert_equal 'Ruby Twitter Gem', Twitter::Search.user_agent
should "default user agent to Twitter Ruby Gem" do
assert_equal 'Twitter Ruby Gem', Twitter::Search.user_agent
end

should "allow overriding default user agent" do
Twitter.user_agent = 'Foobar'
assert_equal 'Ruby Twitter Gem', Twitter::Search.user_agent
assert_equal 'Twitter Ruby Gem', Twitter::Search.user_agent
# Reset
Twitter.user_agent = Twitter.default_user_agent
end
Expand Down
4 changes: 2 additions & 2 deletions test/twitter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class TwitterTest < Test::Unit::TestCase
end
end

should "default user_agent to 'Ruby Twitter Gem'" do
assert_equal 'Ruby Twitter Gem', Twitter.user_agent
should "default user_agent to 'Twitter Ruby Gem'" do
assert_equal 'Twitter Ruby Gem', Twitter.user_agent
end

context "when overriding user_agent" do
Expand Down
2 changes: 1 addition & 1 deletion website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Ruby Twitter Gem by John Nunemaker</title>
<title>Twitter Ruby Gem by John Nunemaker</title>
<link rel="stylesheet" href="css/common.css" type="text/css" />
</head>
<body>
Expand Down

0 comments on commit 2929e53

Please sign in to comment.