Skip to content

Commit 3feab9a

Browse files
committed
Convert specs to RSpec 2.99.2 syntax with Transpec
This conversion is done by Transpec 3.3.0 with the following command: transpec --force --convert stub_with_hash * 899 conversions from: obj.should to: expect(obj).to * 61 conversions from: be_false to: be_falsey * 37 conversions from: be_true to: be_truthy * 11 conversions from: lambda { }.should to: expect { }.to * 4 conversions from: =~ /pattern/ to: match(/pattern/) * 3 conversions from: == expected to: eq(expected) * 2 conversions from: obj.should_not to: expect(obj).not_to * 2 conversions from: obj.stub!(:message) to: allow(obj).to receive(:message) For more details: https://github.com/yujinakayama/transpec#supported-conversions
1 parent 33f11db commit 3feab9a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1288
-1288
lines changed

spec/twitter/action/favorite_spec.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
describe "#sources" do
66
it "returns a collection of users who favorited a Tweet" do
77
sources = Twitter::Action::Favorite.new(:sources => [{:id => 7505382}]).sources
8-
sources.should be_an Array
9-
sources.first.should be_a Twitter::User
8+
expect(sources).to be_an Array
9+
expect(sources.first).to be_a Twitter::User
1010
end
1111
it "is empty when not set" do
1212
sources = Twitter::Action::Favorite.new.sources
13-
sources.should be_empty
13+
expect(sources).to be_empty
1414
end
1515
end
1616

1717
describe "#targets" do
1818
it "returns a collection containing the favorited Tweet" do
1919
targets = Twitter::Action::Favorite.new(:targets => [{:id => 25938088801}]).targets
20-
targets.should be_an Array
21-
targets.first.should be_a Twitter::Tweet
20+
expect(targets).to be_an Array
21+
expect(targets.first).to be_a Twitter::Tweet
2222
end
2323
it "is empty when not set" do
2424
targets = Twitter::Action::Favorite.new.targets
25-
targets.should be_empty
25+
expect(targets).to be_empty
2626
end
2727
end
2828

spec/twitter/action/follow_spec.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
describe "#sources" do
66
it "returns a collection of users who followed a user" do
77
sources = Twitter::Action::Follow.new(:sources => [{:id => 7505382}]).sources
8-
sources.should be_an Array
9-
sources.first.should be_a Twitter::User
8+
expect(sources).to be_an Array
9+
expect(sources.first).to be_a Twitter::User
1010
end
1111
it "is empty when not set" do
1212
sources = Twitter::Action::Follow.new.sources
13-
sources.should be_empty
13+
expect(sources).to be_empty
1414
end
1515
end
1616

1717
describe "#targets" do
1818
it "returns a collection containing the followed user" do
1919
targets = Twitter::Action::Follow.new(:targets => [{:id => 7505382}]).targets
20-
targets.should be_an Array
21-
targets.first.should be_a Twitter::User
20+
expect(targets).to be_an Array
21+
expect(targets.first).to be_a Twitter::User
2222
end
2323
it "is empty when not set" do
2424
targets = Twitter::Action::Follow.new.targets
25-
targets.should be_empty
25+
expect(targets).to be_empty
2626
end
2727
end
2828

spec/twitter/action/list_member_added_spec.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,36 @@
55
describe "#sources" do
66
it "returns a collection of users who added a user to a list" do
77
sources = Twitter::Action::ListMemberAdded.new(:sources => [{:id => 7505382}]).sources
8-
sources.should be_an Array
9-
sources.first.should be_a Twitter::User
8+
expect(sources).to be_an Array
9+
expect(sources.first).to be_a Twitter::User
1010
end
1111
it "is empty when not set" do
1212
sources = Twitter::Action::ListMemberAdded.new.sources
13-
sources.should be_empty
13+
expect(sources).to be_empty
1414
end
1515
end
1616

1717
describe "#target_objects" do
1818
it "returns a collection of lists that were added to" do
1919
targets = Twitter::Action::ListMemberAdded.new(:target_objects => [{:id => 8863586}]).target_objects
20-
targets.should be_an Array
21-
targets.first.should be_a Twitter::List
20+
expect(targets).to be_an Array
21+
expect(targets.first).to be_a Twitter::List
2222
end
2323
it "is empty when not set" do
2424
targets = Twitter::Action::ListMemberAdded.new.target_objects
25-
targets.should be_empty
25+
expect(targets).to be_empty
2626
end
2727
end
2828

2929
describe "#targets" do
3030
it "returns a collection of users who were added to a list" do
3131
targets = Twitter::Action::ListMemberAdded.new(:targets => [{:id => 7505382}]).targets
32-
targets.should be_an Array
33-
targets.first.should be_a Twitter::User
32+
expect(targets).to be_an Array
33+
expect(targets.first).to be_a Twitter::User
3434
end
3535
it "is empty when not set" do
3636
targets = Twitter::Action::ListMemberAdded.new.targets
37-
targets.should be_empty
37+
expect(targets).to be_empty
3838
end
3939
end
4040

spec/twitter/action/mention_spec.rb

+11-11
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,47 @@
55
describe "#sources" do
66
it "returns a collection of users who mentioned a user" do
77
sources = Twitter::Action::Mention.new(:sources => [{:id => 7505382}]).sources
8-
sources.should be_an Array
9-
sources.first.should be_a Twitter::User
8+
expect(sources).to be_an Array
9+
expect(sources.first).to be_a Twitter::User
1010
end
1111
it "is empty when not set" do
1212
sources = Twitter::Action::Mention.new.sources
13-
sources.should be_empty
13+
expect(sources).to be_empty
1414
end
1515
end
1616

1717
describe "#source" do
1818
it "returns the user who mentioned a user" do
1919
source = Twitter::Action::Mention.new(:sources => [{:id => 7505382}]).source
20-
source.should be_a Twitter::User
20+
expect(source).to be_a Twitter::User
2121
end
2222
it "returns nil when not set" do
2323
source = Twitter::Action::Mention.new.source
24-
source.should be_nil
24+
expect(source).to be_nil
2525
end
2626
end
2727

2828
describe "#target_objects" do
2929
it "returns a collection of Tweets that mention a user" do
3030
targets = Twitter::Action::Mention.new(:target_objects => [{:id => 25938088801}]).target_objects
31-
targets.should be_an Array
32-
targets.first.should be_a Twitter::Tweet
31+
expect(targets).to be_an Array
32+
expect(targets.first).to be_a Twitter::Tweet
3333
end
3434
it "is empty when not set" do
3535
targets = Twitter::Action::Mention.new.target_objects
36-
targets.should be_empty
36+
expect(targets).to be_empty
3737
end
3838
end
3939

4040
describe "#targets" do
4141
it "returns a collection containing the mentioned user" do
4242
targets = Twitter::Action::Mention.new(:targets => [{:id => 7505382}]).targets
43-
targets.should be_an Array
44-
targets.first.should be_a Twitter::User
43+
expect(targets).to be_an Array
44+
expect(targets.first).to be_a Twitter::User
4545
end
4646
it "is empty when not set" do
4747
targets = Twitter::Action::Mention.new.targets
48-
targets.should be_empty
48+
expect(targets).to be_empty
4949
end
5050
end
5151

spec/twitter/action/reply_spec.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,36 @@
55
describe "#sources" do
66
it "returns a collection of users who replied to a user" do
77
sources = Twitter::Action::Reply.new(:sources => [{:id => 7505382}]).sources
8-
sources.should be_an Array
9-
sources.first.should be_a Twitter::User
8+
expect(sources).to be_an Array
9+
expect(sources.first).to be_a Twitter::User
1010
end
1111
it "is empty when not set" do
1212
sources = Twitter::Action::Reply.new.sources
13-
sources.should be_empty
13+
expect(sources).to be_empty
1414
end
1515
end
1616

1717
describe "#target_objects" do
1818
it "returns a collection of Tweets that reply to a user" do
1919
targets = Twitter::Action::Reply.new(:target_objects => [{:id => 25938088801}]).target_objects
20-
targets.should be_an Array
21-
targets.first.should be_a Twitter::Tweet
20+
expect(targets).to be_an Array
21+
expect(targets.first).to be_a Twitter::Tweet
2222
end
2323
it "is empty when not set" do
2424
targets = Twitter::Action::Reply.new.target_objects
25-
targets.should be_empty
25+
expect(targets).to be_empty
2626
end
2727
end
2828

2929
describe "#targets" do
3030
it "returns a collection that contains the replied-to status" do
3131
targets = Twitter::Action::Reply.new(:targets => [{:id => 25938088801}]).targets
32-
targets.should be_an Array
33-
targets.first.should be_a Twitter::Tweet
32+
expect(targets).to be_an Array
33+
expect(targets.first).to be_a Twitter::Tweet
3434
end
3535
it "is empty when not set" do
3636
targets = Twitter::Action::Reply.new.targets
37-
targets.should be_empty
37+
expect(targets).to be_empty
3838
end
3939
end
4040

spec/twitter/action/retweet_spec.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,36 @@
55
describe "#sources" do
66
it "returns a collection of users who retweeted a user" do
77
sources = Twitter::Action::Retweet.new(:sources => [{:id => 7505382}]).sources
8-
sources.should be_an Array
9-
sources.first.should be_a Twitter::User
8+
expect(sources).to be_an Array
9+
expect(sources.first).to be_a Twitter::User
1010
end
1111
it "is empty when not set" do
1212
sources = Twitter::Action::Retweet.new.sources
13-
sources.should be_empty
13+
expect(sources).to be_empty
1414
end
1515
end
1616

1717
describe "#target_objects" do
1818
it "returns a collection of retweets" do
1919
targets = Twitter::Action::Retweet.new(:target_objects => [{:id => 25938088801}]).target_objects
20-
targets.should be_an Array
21-
targets.first.should be_a Twitter::Tweet
20+
expect(targets).to be_an Array
21+
expect(targets.first).to be_a Twitter::Tweet
2222
end
2323
it "is empty when not set" do
2424
targets = Twitter::Action::Retweet.new.target_objects
25-
targets.should be_empty
25+
expect(targets).to be_empty
2626
end
2727
end
2828

2929
describe "#targets" do
3030
it "returns a collection containing the retweeted user" do
3131
targets = Twitter::Action::Retweet.new(:targets => [{:id => 7505382}]).targets
32-
targets.should be_an Array
33-
targets.first.should be_a Twitter::User
32+
expect(targets).to be_an Array
33+
expect(targets.first).to be_a Twitter::User
3434
end
3535
it "is empty when not set" do
3636
targets = Twitter::Action::Retweet.new.targets
37-
targets.should be_empty
37+
expect(targets).to be_empty
3838
end
3939
end
4040

spec/twitter/action_factory_spec.rb

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@
55
describe ".new" do
66
it "generates a Favorite" do
77
action = Twitter::ActionFactory.fetch_or_new(:action => 'favorite')
8-
action.should be_a Twitter::Action::Favorite
8+
expect(action).to be_a Twitter::Action::Favorite
99
end
1010
it "generates a Follow" do
1111
action = Twitter::ActionFactory.fetch_or_new(:action => 'follow')
12-
action.should be_a Twitter::Action::Follow
12+
expect(action).to be_a Twitter::Action::Follow
1313
end
1414
it "generates a ListMemberAdded" do
1515
action = Twitter::ActionFactory.fetch_or_new(:action => 'list_member_added')
16-
action.should be_a Twitter::Action::ListMemberAdded
16+
expect(action).to be_a Twitter::Action::ListMemberAdded
1717
end
1818
it "generates a Mention" do
1919
action = Twitter::ActionFactory.fetch_or_new(:action => 'mention')
20-
action.should be_a Twitter::Action::Mention
20+
expect(action).to be_a Twitter::Action::Mention
2121
end
2222
it "generates a Reply" do
2323
action = Twitter::ActionFactory.fetch_or_new(:action => 'reply')
24-
action.should be_a Twitter::Action::Reply
24+
expect(action).to be_a Twitter::Action::Reply
2525
end
2626
it "generates a Retweet" do
2727
action = Twitter::ActionFactory.fetch_or_new(:action => 'retweet')
28-
action.should be_a Twitter::Action::Retweet
28+
expect(action).to be_a Twitter::Action::Retweet
2929
end
3030
it "raises an ArgumentError when action is not specified" do
31-
lambda do
31+
expect do
3232
Twitter::ActionFactory.fetch_or_new
33-
end.should raise_error(ArgumentError, "argument must have :action key")
33+
end.to raise_error(ArgumentError, "argument must have :action key")
3434
end
3535
end
3636

spec/twitter/action_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
describe "#created_at" do
66
it "returns a Time when created_at is set" do
77
user = Twitter::User.new(:id => 7505382, :created_at => "Mon Jul 16 12:59:01 +0000 2007")
8-
user.created_at.should be_a Time
8+
expect(user.created_at).to be_a Time
99
end
1010
it "returns nil when created_at is not set" do
1111
user = Twitter::User.new(:id => 7505382)
12-
user.created_at.should be_nil
12+
expect(user.created_at).to be_nil
1313
end
1414
end
1515

0 commit comments

Comments
 (0)