From 5e1d7657c0ee266e57ed9a9b4a7dee94c1749604 Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Thu, 21 Jun 2012 07:39:03 -0700 Subject: [PATCH] Update specs --- spec/cli_spec.rb | 40 ++++++++++----------- spec/fixtures/status_no_attributes.json | 4 +-- spec/fixtures/status_no_country.json | 4 +-- spec/fixtures/status_no_full_name.json | 4 +-- spec/fixtures/status_no_locality.json | 4 +-- spec/fixtures/status_no_street_address.json | 4 +-- spec/format_helpers_spec.rb | 12 +++---- spec/list_spec.rb | 6 ++-- spec/search_spec.rb | 6 ++-- 9 files changed, 42 insertions(+), 42 deletions(-) diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb index 1d08a8f5..f8edbd67 100644 --- a/spec/cli_spec.rb +++ b/spec/cli_spec.rb @@ -43,7 +43,7 @@ describe "#authorize" do before do - @cli.options = @cli.options.merge("profile" => project_path + "/tmp/trc", "display-url" => true) + @cli.options = @cli.options.merge("profile" => project_path + "/tmp/authorize", "display-url" => true) stub_post("/oauth/request_token"). to_return(:body => fixture("request_token")) stub_post("/oauth/access_token"). @@ -529,7 +529,7 @@ $stdout.string.should == <<-eos ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name 14100886,2008-03-08 16:34:22 +0000,2010-10-21 10:33:15 +0000,3913,32,185,1871,2767,pengwynn,Wynn Netherland -7505382,2007-07-16 12:59:01 +0000,,2962,727,29,88,898,sferik,Erik Michaels-Ober +7505382,2007-07-16 12:59:01 +0000,2011-01-16 21:38:25 +0000,2962,727,29,88,898,sferik,Erik Michaels-Ober eos end end @@ -578,7 +578,7 @@ $stdout.string.should == <<-eos ID Since Last tweeted at Tweets Favorites Listed Following... 14100886 Mar 8 2008 Oct 21 2010 3913 32 185 1871... - 7505382 Jul 16 2007 2962 727 29 88... + 7505382 Jul 16 2007 Jan 16 2011 2962 727 29 88... eos end end @@ -615,7 +615,7 @@ end it "should sort by the time of the last Tweet" do @cli.groupies - $stdout.string.chomp.should == "sferik pengwynn" + $stdout.string.chomp.should == "pengwynn sferik" end end context "--unsorted" do @@ -1260,7 +1260,7 @@ $stdout.string.should == <<-eos ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name 14100886,2008-03-08 16:34:22 +0000,2010-10-21 10:33:15 +0000,3913,32,185,1871,2767,pengwynn,Wynn Netherland -7505382,2007-07-16 12:59:01 +0000,,2962,727,29,88,898,sferik,Erik Michaels-Ober +7505382,2007-07-16 12:59:01 +0000,2011-01-16 21:38:25 +0000,2962,727,29,88,898,sferik,Erik Michaels-Ober eos end end @@ -1309,7 +1309,7 @@ $stdout.string.should == <<-eos ID Since Last tweeted at Tweets Favorites Listed Following... 14100886 Mar 8 2008 Oct 21 2010 3913 32 185 1871... - 7505382 Jul 16 2007 2962 727 29 88... + 7505382 Jul 16 2007 Jan 16 2011 2962 727 29 88... eos end end @@ -1346,7 +1346,7 @@ end it "should sort by the time of the last Tweet" do @cli.followings - $stdout.string.chomp.should == "sferik pengwynn" + $stdout.string.chomp.should == "pengwynn sferik" end end context "--unsorted" do @@ -1424,7 +1424,7 @@ $stdout.string.should == <<-eos ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name 14100886,2008-03-08 16:34:22 +0000,2010-10-21 10:33:15 +0000,3913,32,185,1871,2767,pengwynn,Wynn Netherland -7505382,2007-07-16 12:59:01 +0000,,2962,727,29,88,898,sferik,Erik Michaels-Ober +7505382,2007-07-16 12:59:01 +0000,2011-01-16 21:38:25 +0000,2962,727,29,88,898,sferik,Erik Michaels-Ober eos end end @@ -1473,7 +1473,7 @@ $stdout.string.should == <<-eos ID Since Last tweeted at Tweets Favorites Listed Following... 14100886 Mar 8 2008 Oct 21 2010 3913 32 185 1871... - 7505382 Jul 16 2007 2962 727 29 88... + 7505382 Jul 16 2007 Jan 16 2011 2962 727 29 88... eos end end @@ -1510,7 +1510,7 @@ end it "should sort by the time of the last Tweet" do @cli.followers - $stdout.string.chomp.should == "sferik pengwynn" + $stdout.string.chomp.should == "pengwynn sferik" end end context "--unsorted" do @@ -1597,7 +1597,7 @@ $stdout.string.should == <<-eos ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name 14100886,2008-03-08 16:34:22 +0000,2010-10-21 10:33:15 +0000,3913,32,185,1871,2767,pengwynn,Wynn Netherland -7505382,2007-07-16 12:59:01 +0000,,2962,727,29,88,898,sferik,Erik Michaels-Ober +7505382,2007-07-16 12:59:01 +0000,2011-01-16 21:38:25 +0000,2962,727,29,88,898,sferik,Erik Michaels-Ober eos end end @@ -1646,7 +1646,7 @@ $stdout.string.should == <<-eos ID Since Last tweeted at Tweets Favorites Listed Following... 14100886 Mar 8 2008 Oct 21 2010 3913 32 185 1871... - 7505382 Jul 16 2007 2962 727 29 88... + 7505382 Jul 16 2007 Jan 16 2011 2962 727 29 88... eos end end @@ -1683,7 +1683,7 @@ end it "should sort by the time of the last Tweet" do @cli.friends - $stdout.string.chomp.should == "sferik pengwynn" + $stdout.string.chomp.should == "pengwynn sferik" end end context "--unsorted" do @@ -1779,7 +1779,7 @@ $stdout.string.should == <<-eos ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name 14100886,2008-03-08 16:34:22 +0000,2010-10-21 10:33:15 +0000,3913,32,185,1871,2767,pengwynn,Wynn Netherland -7505382,2007-07-16 12:59:01 +0000,,2962,727,29,88,898,sferik,Erik Michaels-Ober +7505382,2007-07-16 12:59:01 +0000,2011-01-16 21:38:25 +0000,2962,727,29,88,898,sferik,Erik Michaels-Ober eos end end @@ -1828,8 +1828,8 @@ $stdout.string.should == <<-eos ID Since Last tweeted at Tweets Favorites Listed Following... 14100886 Mar 8 2008 Oct 21 2010 3913 32 185 1871... - 7505382 Jul 16 2007 2962 727 29 88... - eos + 7505382 Jul 16 2007 Jan 16 2011 2962 727 29 88... + eos end end context "--posted" do @@ -1865,7 +1865,7 @@ end it "should sort by the time of the last Tweet" do @cli.leaders - $stdout.string.chomp.should == "sferik pengwynn" + $stdout.string.chomp.should == "pengwynn sferik" end end context "--unsorted" do @@ -3528,7 +3528,7 @@ $stdout.string.should == <<-eos ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name 14100886,2008-03-08 16:34:22 +0000,2010-10-21 10:33:15 +0000,3913,32,185,1871,2767,pengwynn,Wynn Netherland -7505382,2007-07-16 12:59:01 +0000,,2962,727,29,88,898,sferik,Erik Michaels-Ober +7505382,2007-07-16 12:59:01 +0000,2011-01-16 21:38:25 +0000,2962,727,29,88,898,sferik,Erik Michaels-Ober eos end end @@ -3591,7 +3591,7 @@ $stdout.string.should == <<-eos ID Since Last tweeted at Tweets Favorites Listed Following... 14100886 Mar 8 2008 Oct 21 2010 3913 32 185 1871... - 7505382 Jul 16 2007 2962 727 29 88... + 7505382 Jul 16 2007 Jan 16 2011 2962 727 29 88... eos end end @@ -3628,7 +3628,7 @@ end it "should sort by the time of the last Tweet" do @cli.users("sferik", "pengwynn") - $stdout.string.chomp.should == "sferik pengwynn" + $stdout.string.chomp.should == "pengwynn sferik" end end context "--unsorted" do diff --git a/spec/fixtures/status_no_attributes.json b/spec/fixtures/status_no_attributes.json index dc19021e..733c9b3a 100644 --- a/spec/fixtures/status_no_attributes.json +++ b/spec/fixtures/status_no_attributes.json @@ -1,7 +1,7 @@ { "created_at": "Wed Apr 06 19:13:37 +0000 2011", "id": 55709764298092546, - "id_str": "55709764298092545", + "id_str": "55709764298092546", "text": "The problem with your code is that it's doing exactly what you told it to do.", "source": "Twitter for iPhone", "truncated": false, @@ -101,4 +101,4 @@ "favorited": false, "retweeted": false, "possibly_sensitive": false -} \ No newline at end of file +} diff --git a/spec/fixtures/status_no_country.json b/spec/fixtures/status_no_country.json index 0bf0353a..234b0896 100644 --- a/spec/fixtures/status_no_country.json +++ b/spec/fixtures/status_no_country.json @@ -1,7 +1,7 @@ { "created_at": "Wed Apr 06 19:13:37 +0000 2011", "id": 55709764298092547, - "id_str": "55709764298092545", + "id_str": "55709764298092547", "text": "The problem with your code is that it's doing exactly what you told it to do.", "source": "Twitter for iPhone", "truncated": false, @@ -99,4 +99,4 @@ "favorited": false, "retweeted": false, "possibly_sensitive": false -} \ No newline at end of file +} diff --git a/spec/fixtures/status_no_full_name.json b/spec/fixtures/status_no_full_name.json index 33d9cdde..55b219cf 100644 --- a/spec/fixtures/status_no_full_name.json +++ b/spec/fixtures/status_no_full_name.json @@ -1,7 +1,7 @@ { "created_at": "Wed Apr 06 19:13:37 +0000 2011", "id": 55709764298092548, - "id_str": "55709764298092545", + "id_str": "55709764298092548", "text": "The problem with your code is that it's doing exactly what you told it to do.", "source": "Twitter for iPhone", "truncated": false, @@ -98,4 +98,4 @@ "favorited": false, "retweeted": false, "possibly_sensitive": false -} \ No newline at end of file +} diff --git a/spec/fixtures/status_no_locality.json b/spec/fixtures/status_no_locality.json index c958ddcc..2aa8a392 100644 --- a/spec/fixtures/status_no_locality.json +++ b/spec/fixtures/status_no_locality.json @@ -1,7 +1,7 @@ { "created_at": "Wed Apr 06 19:13:37 +0000 2011", "id": 55709764298092549, - "id_str": "55709764298092545", + "id_str": "55709764298092549", "text": "The problem with your code is that it's doing exactly what you told it to do.", "source": "Twitter for iPhone", "truncated": false, @@ -104,4 +104,4 @@ "favorited": false, "retweeted": false, "possibly_sensitive": false -} \ No newline at end of file +} diff --git a/spec/fixtures/status_no_street_address.json b/spec/fixtures/status_no_street_address.json index eea8c3ad..f8a8af6b 100644 --- a/spec/fixtures/status_no_street_address.json +++ b/spec/fixtures/status_no_street_address.json @@ -1,7 +1,7 @@ { "created_at": "Wed Apr 06 19:13:37 +0000 2011", "id": 55709764298092550, - "id_str": "55709764298092545", + "id_str": "55709764298092550", "text": "The problem with your code is that it's doing exactly what you told it to do.", "source": "Twitter for iPhone", "truncated": false, @@ -105,4 +105,4 @@ "favorited": false, "retweeted": false, "possibly_sensitive": false -} \ No newline at end of file +} diff --git a/spec/format_helpers_spec.rb b/spec/format_helpers_spec.rb index 17d331e8..0f27d9b2 100644 --- a/spec/format_helpers_spec.rb +++ b/spec/format_helpers_spec.rb @@ -6,6 +6,12 @@ before :all do Timecop.freeze(Time.utc(2011, 11, 24, 16, 20, 0)) T.utc_offset = 'PST' + class Test; end + end + + before :each do + @test = Test.new + @test.extend(T::FormatHelpers) end after :all do @@ -13,12 +19,6 @@ Timecop.return end - before do - class Test; end - @test = Test.new - @test.extend(T::FormatHelpers) - end - describe "#distance_of_time_in_words" do it "returns \"a split second\" if difference is less than a second" do @test.send(:distance_of_time_in_words, (Time.utc(2011, 11, 24, 16, 20, 0))).should == "a split second" diff --git a/spec/list_spec.rb b/spec/list_spec.rb index 72e88214..d568cd35 100644 --- a/spec/list_spec.rb +++ b/spec/list_spec.rb @@ -188,7 +188,7 @@ $stdout.string.should == <<-eos ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name 14100886,2008-03-08 16:34:22 +0000,2010-10-21 10:33:15 +0000,3913,32,185,1871,2767,pengwynn,Wynn Netherland -7505382,2007-07-16 12:59:01 +0000,,2962,727,29,88,898,sferik,Erik Michaels-Ober +7505382,2007-07-16 12:59:01 +0000,2011-01-16 21:38:25 +0000,2962,727,29,88,898,sferik,Erik Michaels-Ober eos end end @@ -237,7 +237,7 @@ $stdout.string.should == <<-eos ID Since Last tweeted at Tweets Favorites Listed Following... 14100886 Mar 8 2008 Oct 21 2010 3913 32 185 1871... - 7505382 Jul 16 2007 2962 727 29 88... + 7505382 Jul 16 2007 Jan 16 2011 2962 727 29 88... eos end end @@ -274,7 +274,7 @@ end it "should sort by the time of the last Tweet" do @list.members("presidents") - $stdout.string.chomp.should == "sferik pengwynn" + $stdout.string.chomp.should == "pengwynn sferik" end end context "--unsorted" do diff --git a/spec/search_spec.rb b/spec/search_spec.rb index 08dca77a..66c8893f 100644 --- a/spec/search_spec.rb +++ b/spec/search_spec.rb @@ -703,7 +703,7 @@ $stdout.string.should == <<-eos ID,Since,Last tweeted at,Tweets,Favorites,Listed,Following,Followers,Screen name,Name 14100886,2008-03-08 16:34:22 +0000,2010-10-21 10:33:15 +0000,3913,32,185,1871,2767,pengwynn,Wynn Netherland -7505382,2007-07-16 12:59:01 +0000,,2962,727,29,88,898,sferik,Erik Michaels-Ober +7505382,2007-07-16 12:59:01 +0000,2011-01-16 21:38:25 +0000,2962,727,29,88,898,sferik,Erik Michaels-Ober eos end end @@ -752,7 +752,7 @@ $stdout.string.should == <<-eos ID Since Last tweeted at Tweets Favorites Listed Following... 14100886 Mar 8 2008 Oct 21 2010 3913 32 185 1871... - 7505382 Jul 16 2007 2962 727 29 88... + 7505382 Jul 16 2007 Jan 16 2011 2962 727 29 88... eos end end @@ -789,7 +789,7 @@ end it "should sort by the time of the last Tweet" do @search.users("Erik") - $stdout.string.chomp.should == "sferik pengwynn" + $stdout.string.chomp.should == "pengwynn sferik" end end context "--unsorted" do