Skip to content

Commit

Permalink
Replace =~ with match
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Oct 10, 2012
1 parent 7d82ca6 commit a606cba
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion spec/twitter/api/statuses_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@
tweets.first.should be_a Twitter::Tweet
tweets.first.text.should eq "As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush."
tweets.first.retweeted_tweet.text.should eq "RT @gruber: As for the Series, I'm for the Giants. Fuck Texas, fuck Nolan Ryan, fuck George Bush."
tweets.first.retweeted_tweet.id.should_not == tweets.first.id
tweets.first.retweeted_tweet.id.should_not eq tweets.first.id
end
end

Expand Down
38 changes: 19 additions & 19 deletions spec/twitter/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe Twitter::Base do

context 'identity map enabled' do
context "identity map enabled" do
before do
Twitter.identity_map = Twitter::IdentityMap
object = Twitter::Base.new(:id => 1)
Expand All @@ -13,14 +13,14 @@
Twitter.identity_map = false
end

describe '.identity_map' do
it 'returns an instance of the identity map' do
describe ".identity_map" do
it "returns an instance of the identity map" do
Twitter::Base.identity_map.should be_a Twitter::IdentityMap
end
end

describe '.fetch' do
it 'returns existing objects' do
describe ".fetch" do
it "returns existing objects" do
Twitter::Base.fetch(:id => 1).should be
end

Expand All @@ -31,18 +31,18 @@
end
end

describe '.store' do
it 'stores Twitter::Base objects' do
describe ".store" do
it "stores Twitter::Base objects" do
object = Twitter::Base.new(:id => 4)
Twitter::Base.store(object).should be_a Twitter::Base
end
end

describe '.fetch_or_new' do
it 'returns existing objects' do
describe ".fetch_or_new" do
it "returns existing objects" do
Twitter::Base.fetch_or_new(:id => 1).should be
end
it 'creates new objects and stores them' do
it "creates new objects and stores them" do
Twitter::Base.fetch_or_new(:id => 2).should be
Twitter::Base.fetch(:id => 2).should be
end
Expand Down Expand Up @@ -76,34 +76,34 @@

end

context 'identity map disabled' do
context "identity map disabled" do
before(:all) do
Twitter.identity_map = false
end
after(:all) do
Twitter.identity_map = Twitter::IdentityMap
end

describe '.identity_map' do
it 'returns nil' do
describe ".identity_map" do
it "returns nil" do
Twitter::Base.identity_map.should be_nil
end
end

describe '.fetch' do
it 'returns nil' do
describe ".fetch" do
it "returns nil" do
Twitter::Base.fetch(:id => 1).should be_nil
end
end

describe '.store' do
it 'returns an instance of the object' do
describe ".store" do
it "returns an instance of the object" do
Twitter::Base.store(Twitter::Base.new(:id => 1)).should be_a Twitter::Base
end
end

describe '.fetch_or_new' do
it 'creates new objects' do
describe ".fetch_or_new" do
it "creates new objects" do
Twitter::Base.fetch_or_new(:id => 2).should be
Twitter.identity_map.should be_false
end
Expand Down
6 changes: 3 additions & 3 deletions spec/twitter/identifiable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
end
end

context 'identity map enabled' do
context "identity map enabled" do
before do
Twitter.identity_map = Twitter::IdentityMap
end
Expand All @@ -19,8 +19,8 @@
Twitter.identity_map = false
end

describe '.fetch' do
it 'returns existing objects' do
describe ".fetch" do
it "returns existing objects" do
Twitter::Identity.store(Twitter::Identity.new(:id => 1))
Twitter::Identity.fetch(:id => 1).should be
end
Expand Down
8 changes: 4 additions & 4 deletions spec/twitter/tweet_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
end
it "warns when not set" do
Twitter::Tweet.new(:id => 28669546014).hashtags
$stderr.string.should =~ /To get hashtags, you must pass `:include_entities => true` when requesting the Twitter::Tweet\./
$stderr.string.should match /To get hashtags, you must pass `:include_entities => true` when requesting the Twitter::Tweet\./
end
end

Expand All @@ -138,7 +138,7 @@
end
it "warns when not set" do
Twitter::Tweet.new(:id => 28669546014).media
$stderr.string.should =~ /To get media, you must pass `:include_entities => true` when requesting the Twitter::Tweet\./
$stderr.string.should match /To get media, you must pass `:include_entities => true` when requesting the Twitter::Tweet\./
end
end

Expand Down Expand Up @@ -269,7 +269,7 @@
end
it "warns when not set" do
Twitter::Tweet.new(:id => 28669546014).urls
$stderr.string.should =~ /To get urls, you must pass `:include_entities => true` when requesting the Twitter::Tweet\./
$stderr.string.should match /To get urls, you must pass `:include_entities => true` when requesting the Twitter::Tweet\./
end
end

Expand Down Expand Up @@ -311,7 +311,7 @@
end
it "warns when not set" do
Twitter::Tweet.new(:id => 28669546014).user_mentions
$stderr.string.should =~ /To get user mentions, you must pass `:include_entities => true` when requesting the Twitter::Tweet\./
$stderr.string.should match /To get user mentions, you must pass `:include_entities => true` when requesting the Twitter::Tweet\./
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/twitter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

end

describe '.respond_to?' do
describe ".respond_to?" do
it "delegates to Twitter::Client" do
Twitter.respond_to?(:user).should be_true
end
Expand Down

0 comments on commit a606cba

Please sign in to comment.