Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update specs to pass on webmock 1.10.0

  • Loading branch information...
commit f208b72f505f496e38ae10db6cd5cee738b6bba2 1 parent c5e8925
@sferik authored
Showing with 14 additions and 14 deletions.
  1. +2 −2 Gemfile
  2. +8 −8 spec/cli_spec.rb
  3. +4 −4 spec/set_spec.rb
View
4 Gemfile
@@ -11,12 +11,12 @@ group :development do
end
group :test do
- gem 'coveralls', '>= 0.6.0', :require => false
+ gem 'coveralls', :require => false
gem 'nyan-cat-formatter'
gem 'rspec', '>= 2.11'
gem 'simplecov', :require => false
gem 'timecop'
- gem 'webmock', '1.9.3'
+ gem 'webmock', '>= 1.10'
end
gemspec
View
16 spec/cli_spec.rb
@@ -617,11 +617,11 @@
describe "#dm" do
before do
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc")
- stub_post("/1.1/direct_messages/new.json").with(:body => {:screen_name => "pengwynn", :text => "Creating a fixture for the Twitter gem"}).to_return(:body => fixture("direct_message.json"))
+ stub_post("/1.1/direct_messages/new.json").with(:body => {:screen_name => "pengwynn", :text => "Creating+a+fixture+for+the+Twitter+gem"}).to_return(:body => fixture("direct_message.json"))
end
it "requests the correct resource" do
@cli.dm("pengwynn", "Creating a fixture for the Twitter gem")
- expect(a_post("/1.1/direct_messages/new.json").with(:body => {:screen_name => "pengwynn", :text => "Creating a fixture for the Twitter gem"})).to have_been_made
+ expect(a_post("/1.1/direct_messages/new.json").with(:body => {:screen_name => "pengwynn", :text => "Creating+a+fixture+for+the+Twitter+gem"})).to have_been_made
end
it "has the correct output" do
@cli.dm("pengwynn", "Creating a fixture for the Twitter gem")
@@ -630,11 +630,11 @@
context "--id" do
before do
@cli.options = @cli.options.merge("id" => true)
- stub_post("/1.1/direct_messages/new.json").with(:body => {:user_id => "14100886", :text => "Creating a fixture for the Twitter gem"}).to_return(:body => fixture("direct_message.json"))
+ stub_post("/1.1/direct_messages/new.json").with(:body => {:user_id => "14100886", :text => "Creating+a+fixture+for+the+Twitter+gem"}).to_return(:body => fixture("direct_message.json"))
end
it "requests the correct resource" do
@cli.dm("14100886", "Creating a fixture for the Twitter gem")
- expect(a_post("/1.1/direct_messages/new.json").with(:body => {:user_id => "14100886", :text => "Creating a fixture for the Twitter gem"})).to have_been_made
+ expect(a_post("/1.1/direct_messages/new.json").with(:body => {:user_id => "14100886", :text => "Creating+a+fixture+for+the+Twitter+gem"})).to have_been_made
end
end
end
@@ -2014,14 +2014,14 @@
before do
@cli.options = @cli.options.merge("profile" => fixture_path + "/.trc", "location" => true)
stub_get("/1.1/statuses/show/263813522369159169.json").with(:query => {:include_my_retweet => "false"}).to_return(:body => fixture("status_with_mention.json"))
- stub_post("/1.1/statuses/update.json").with(:body => {:in_reply_to_status_id => "263813522369159169", :status => "@joshfrench Testing", :lat => "37.76969909668", :long => "-122.39330291748", :trim_user => "true"}).to_return(:body => fixture("status.json"))
+ stub_post("/1.1/statuses/update.json").with(:body => {:in_reply_to_status_id => "263813522369159169", :status => "@joshfrench+Testing", :lat => "37.76969909668", :long => "-122.39330291748", :trim_user => "true"}).to_return(:body => fixture("status.json"))
stub_request(:get, "http://checkip.dyndns.org/").to_return(:body => fixture("checkip.html"), :headers => {:content_type => "text/html"})
stub_request(:get, "http://www.geoplugin.net/xml.gp?ip=50.131.22.169").to_return(:body => fixture("geoplugin.xml"), :headers => {:content_type => "application/xml"})
end
it "requests the correct resource" do
@cli.reply("263813522369159169", "Testing")
expect(a_get("/1.1/statuses/show/263813522369159169.json").with(:query => {:include_my_retweet => "false"})).to have_been_made
- expect(a_post("/1.1/statuses/update.json").with(:body => {:in_reply_to_status_id => "263813522369159169", :status => "@joshfrench Testing", :lat => "37.76969909668", :long => "-122.39330291748", :trim_user => "true"})).to have_been_made
+ expect(a_post("/1.1/statuses/update.json").with(:body => {:in_reply_to_status_id => "263813522369159169", :status => "@joshfrench+Testing", :lat => "37.76969909668", :long => "-122.39330291748", :trim_user => "true"})).to have_been_made
expect(a_request(:get, "http://checkip.dyndns.org/")).to have_been_made
expect(a_request(:get, "http://www.geoplugin.net/xml.gp?ip=50.131.22.169")).to have_been_made
end
@@ -2032,12 +2032,12 @@
context "--all" do
before do
@cli.options = @cli.options.merge("all" => true)
- stub_post("/1.1/statuses/update.json").with(:body => {:in_reply_to_status_id => "263813522369159169", :status => "@joshfrench @sferik Testing", :lat => "37.76969909668", :long => "-122.39330291748", :trim_user => "true"}).to_return(:body => fixture("status.json"))
+ stub_post("/1.1/statuses/update.json").with(:body => {:in_reply_to_status_id => "263813522369159169", :status => "@joshfrench+@sferik+Testing", :lat => "37.76969909668", :long => "-122.39330291748", :trim_user => "true"}).to_return(:body => fixture("status.json"))
end
it "requests the correct resource" do
@cli.reply("263813522369159169", "Testing")
expect(a_get("/1.1/statuses/show/263813522369159169.json").with(:query => {:include_my_retweet => "false"})).to have_been_made
- expect(a_post("/1.1/statuses/update.json").with(:body => {:in_reply_to_status_id => "263813522369159169", :status => "@joshfrench @sferik Testing", :lat => "37.76969909668", :long => "-122.39330291748", :trim_user => "true"})).to have_been_made
+ expect(a_post("/1.1/statuses/update.json").with(:body => {:in_reply_to_status_id => "263813522369159169", :status => "@joshfrench+@sferik+Testing", :lat => "37.76969909668", :long => "-122.39330291748", :trim_user => "true"})).to have_been_made
expect(a_request(:get, "http://checkip.dyndns.org/")).to have_been_made
expect(a_request(:get, "http://www.geoplugin.net/xml.gp?ip=50.131.22.169")).to have_been_made
end
View
8 spec/set_spec.rb
@@ -79,11 +79,11 @@
describe "#location" do
before do
@set.options = @set.options.merge("profile" => fixture_path + "/.trc")
- stub_post("/1.1/account/update_profile.json").with(:body => {:location => "San Francisco"}).to_return(:body => fixture("sferik.json"))
+ stub_post("/1.1/account/update_profile.json").with(:body => {:location => "San+Francisco"}).to_return(:body => fixture("sferik.json"))
end
it "requests the correct resource" do
@set.location("San Francisco")
- expect(a_post("/1.1/account/update_profile.json").with(:body => {:location => "San Francisco"})).to have_been_made
+ expect(a_post("/1.1/account/update_profile.json").with(:body => {:location => "San+Francisco"})).to have_been_made
end
it "has the correct output" do
@set.location("San Francisco")
@@ -94,11 +94,11 @@
describe "#name" do
before do
@set.options = @set.options.merge("profile" => fixture_path + "/.trc")
- stub_post("/1.1/account/update_profile.json").with(:body => {:name => "Erik Michaels-Ober"}).to_return(:body => fixture("sferik.json"))
+ stub_post("/1.1/account/update_profile.json").with(:body => {:name => "Erik+Michaels-Ober"}).to_return(:body => fixture("sferik.json"))
end
it "requests the correct resource" do
@set.name("Erik Michaels-Ober")
- expect(a_post("/1.1/account/update_profile.json").with(:body => {:name => "Erik Michaels-Ober"})).to have_been_made
+ expect(a_post("/1.1/account/update_profile.json").with(:body => {:name => "Erik+Michaels-Ober"})).to have_been_made
end
it "has the correct output" do
@set.name("Erik Michaels-Ober")
Please sign in to comment.
Something went wrong with that request. Please try again.