diff --git a/Gemfile b/Gemfile index ec023deb..7a53659a 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ group :test do gem 'simplecov', '>= 0.9' gem 'timecop' gem 'tins' - gem 'webmock', '>= 1.10.1' + gem 'webmock', '>= 3.1.0' end gemspec diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb index 5646f6cc..b7334cc2 100644 --- a/spec/cli_spec.rb +++ b/spec/cli_spec.rb @@ -2550,7 +2550,7 @@ context 'with file' do before do @cli.options = @cli.options.merge('file' => fixture_path + '/long.png') - stub_request(:post, 'https://upload.twitter.com/1.1/media/upload.json') + stub_request(:post, 'https://upload.twitter.com/1.1/media/upload.json').to_return(body: fixture('media.json'), headers: {content_type: 'application/json; charset=utf-8'}) stub_post('/1.1/statuses/update.json').to_return(body: fixture('status.json'), headers: {content_type: 'application/json; charset=utf-8'}) end it 'requests the correct resource' do @@ -3892,13 +3892,13 @@ context 'with file' do before do @cli.options = @cli.options.merge('file' => fixture_path + '/long.png') - stub_request(:post, 'https://upload.twitter.com/1.1/media/upload.json') + stub_request(:post, 'https://upload.twitter.com/1.1/media/upload.json').to_return(body: fixture('media.json'), headers: {content_type: 'application/json; charset=utf-8'}) stub_post('/1.1/statuses/update.json').to_return(body: fixture('status.json'), headers: {content_type: 'application/json; charset=utf-8'}) end it 'requests the correct resource' do @cli.update('Testing') expect(a_request(:post, 'https://upload.twitter.com/1.1/media/upload.json')).to have_been_made - expect(a_post('/1.1/statuses/update_with_media.json')).to have_been_made + expect(a_post('/1.1/statuses/update.json')).to have_been_made end it 'has the correct output' do @cli.update('Testing') diff --git a/spec/fixtures/media.json b/spec/fixtures/media.json new file mode 100644 index 00000000..28fc2e43 --- /dev/null +++ b/spec/fixtures/media.json @@ -0,0 +1 @@ +{"image":{"w":428,"h":428,"image_type":"image/png"},"media_id":470030289822314497,"media_id_string":"470030289822314497","size":68900} diff --git a/t.gemspec b/t.gemspec index 934aaac5..398643b7 100644 --- a/t.gemspec +++ b/t.gemspec @@ -10,8 +10,8 @@ Gem::Specification.new do |spec| spec.add_dependency 'oauth', '~> 0.5.1' spec.add_dependency 'retryable', '~> 2.0' spec.add_dependency 'thor', ['>= 0.19.1', '< 2'] - spec.add_dependency 'twitter', '~> 6.0' - spec.add_development_dependency 'bundler', '~> 1.0' + spec.add_dependency 'twitter', '~> 6.2' + spec.add_development_dependency 'bundler', '~> 2.1' spec.author = 'Erik Michaels-Ober' spec.description = 'A command-line power tool for Twitter.' spec.email = 'sferik@gmail.com'