diff --git a/Gemfile.lock b/Gemfile.lock index 4acb65ce6..5d536de1b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -384,20 +384,20 @@ GEM rpm_contrib (2.1.11) newrelic_rpm (>= 3.1.1) newrelic_rpm (>= 3.1.1) - rspec (2.10.0) - rspec-core (~> 2.10.0) - rspec-expectations (~> 2.10.0) - rspec-mocks (~> 2.10.0) - rspec-core (2.10.1) - rspec-expectations (2.10.0) + rspec (2.11.0) + rspec-core (~> 2.11.0) + rspec-expectations (~> 2.11.0) + rspec-mocks (~> 2.11.0) + rspec-core (2.11.1) + rspec-expectations (2.11.3) diff-lcs (~> 1.1.3) rspec-instafail (0.2.4) - rspec-mocks (2.10.1) - rspec-rails (2.10.1) + rspec-mocks (2.11.2) + rspec-rails (2.11.0) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec (~> 2.10.0) + rspec (~> 2.11.0) ruby-debug (0.10.4) columnize (>= 0.1) ruby-debug-base (~> 0.10.4.0) diff --git a/spec/controllers/blocks_controller_spec.rb b/spec/controllers/blocks_controller_spec.rb index 0fe07a91c..de1f81663 100644 --- a/spec/controllers/blocks_controller_spec.rb +++ b/spec/controllers/blocks_controller_spec.rb @@ -9,7 +9,7 @@ describe BlocksController do it "creates a block" do expect { post :create, :block => {:person_id => eve.person.id} - }.should change { alice.blocks.count }.by(1) + }.to change { alice.blocks.count }.by(1) end it "redirects back" do @@ -43,7 +43,7 @@ describe BlocksController do it "removes a block" do expect { delete :destroy, :id => @block.id - }.should change { alice.blocks.count }.by(-1) + }.to change { alice.blocks.count }.by(-1) end end diff --git a/spec/controllers/likes_controller_spec.rb b/spec/controllers/likes_controller_spec.rb index f963e9963..dfaddc413 100644 --- a/spec/controllers/likes_controller_spec.rb +++ b/spec/controllers/likes_controller_spec.rb @@ -124,7 +124,7 @@ describe LikesController do like_count = Like.count expect { delete :destroy, :format => :json, id_field => like2.target_id, :id => like2.id - }.should raise_error(ActiveRecord::RecordNotFound) + }.to raise_error(ActiveRecord::RecordNotFound) Like.count.should == like_count diff --git a/spec/controllers/reshares_controller_spec.rb b/spec/controllers/reshares_controller_spec.rb index 9b400fa82..b9ac6b478 100644 --- a/spec/controllers/reshares_controller_spec.rb +++ b/spec/controllers/reshares_controller_spec.rb @@ -29,7 +29,7 @@ describe ResharesController do it 'creates a reshare' do expect{ post_request! - }.should change(Reshare, :count).by(1) + }.to change(Reshare, :count).by(1) end it 'after save, calls add to streams' do diff --git a/spec/controllers/status_messages_controller_spec.rb b/spec/controllers/status_messages_controller_spec.rb index 2effdac35..0e7614ab3 100644 --- a/spec/controllers/status_messages_controller_spec.rb +++ b/spec/controllers/status_messages_controller_spec.rb @@ -226,7 +226,7 @@ describe StatusMessagesController do alice.save expect{ @controller.remove_getting_started - }.should change{ + }.to change{ alice.reload.getting_started }.from(true).to(false) end @@ -234,7 +234,7 @@ describe StatusMessagesController do it 'does nothing for returning users' do expect{ @controller.remove_getting_started - }.should_not change{ + }.to_not change{ alice.reload.getting_started } end diff --git a/spec/helpers/notifications_helper_spec.rb b/spec/helpers/notifications_helper_spec.rb index 15804b00b..f35eda7ba 100644 --- a/spec/helpers/notifications_helper_spec.rb +++ b/spec/helpers/notifications_helper_spec.rb @@ -83,7 +83,7 @@ describe NotificationsHelper do context 'when post is deleted' do it 'works' do @post.destroy - expect{ object_link(@notification, notification_people_link(@notification))}.should_not raise_error + expect{ object_link(@notification, notification_people_link(@notification))}.to_not raise_error end it 'displays that the post was deleted' do diff --git a/spec/integration/attack_vectors_spec.rb b/spec/integration/attack_vectors_spec.rb index 110c1d500..58671cce2 100644 --- a/spec/integration/attack_vectors_spec.rb +++ b/spec/integration/attack_vectors_spec.rb @@ -88,7 +88,7 @@ describe "attack vectors" do expect_error /Contact required/ do zord.perform! end - }.should_not change(Post, :count) + }.to_not change(Post, :count) user_should_not_see_guid(bob, bad_post_guid) end @@ -128,7 +128,7 @@ describe "attack vectors" do expect_error /Author does not match XML author/ do receive(profile, :from => alice, :by => bob) end - }.should_not change(eve.profile, :first_name) + }.to_not change(eve.profile, :first_name) end end @@ -154,7 +154,7 @@ describe "attack vectors" do expect{ receive(malicious_message, :from => alice, :by => bob) - }.should_not change(original_message, :author_id) + }.to_not change(original_message, :author_id) end it 'does not save a message over an old message with the same author' do @@ -167,7 +167,7 @@ describe "attack vectors" do expect { receive(malicious_message, :from => eve, :by => bob) - }.should_not change(original_message, :text) + }.to_not change(original_message, :text) end end @@ -183,7 +183,7 @@ describe "attack vectors" do expect { receive(ret, :from => alice, :by => bob) - }.should_not change(StatusMessage, :count) + }.to_not change(StatusMessage, :count) end it "silently disregards retractions for non-existent posts(that are from someone other than the post's author)" do @@ -196,7 +196,7 @@ describe "attack vectors" do end expect{ receive(bogus_retraction, :from => alice, :by => bob) - }.should_not raise_error + }.to_not raise_error end it 'should not receive retractions where the retractor and the salmon author do not match' do @@ -212,7 +212,7 @@ describe "attack vectors" do expect_error /Author does not match XML author/ do receive(retraction, :from => alice, :by => bob) end - }.should_not change(bob.visible_shareables(Post), :count) + }.to_not change(bob.visible_shareables(Post), :count) end @@ -228,7 +228,7 @@ describe "attack vectors" do expect{ receive(retraction, :from => alice, :by => bob) - }.should_not change{bob.reload.contacts.count} + }.to_not change{bob.reload.contacts.count} end it 'it should not allow you to send retractions with xml and salmon handle mismatch' do @@ -242,7 +242,7 @@ describe "attack vectors" do expect_error /Author does not match XML author/ do receive(retraction, :from => alice, :by => bob) end - }.should_not change(bob.contacts, :count) + }.to_not change(bob.contacts, :count) end it 'does not let another user update other persons post' do @@ -256,7 +256,7 @@ describe "attack vectors" do expect{ receive(new_message, :from => alice, :by => bob) - }.should_not change(original_message, :text) + }.to_not change(original_message, :text) end end end diff --git a/spec/lib/i18n_interpolation_fallbacks_spec.rb b/spec/lib/i18n_interpolation_fallbacks_spec.rb index bb5191c1b..244512847 100644 --- a/spec/lib/i18n_interpolation_fallbacks_spec.rb +++ b/spec/lib/i18n_interpolation_fallbacks_spec.rb @@ -23,7 +23,7 @@ describe "i18n interpolation fallbacks" do I18n.t('ago').should == "%{time} ago" end it "raises a MissingInterpolationArgument when arguments are wrong" do - expect { I18n.t('ago', :not_time => "2 months") }.should raise_exception(I18n::MissingInterpolationArgument) + expect { I18n.t('ago', :not_time => "2 months") }.to raise_exception(I18n::MissingInterpolationArgument) end end context "current locale falls back to English" do @@ -55,7 +55,7 @@ describe "i18n interpolation fallbacks" do describe "when the English translation does not work" do it "raises a MissingInterpolationArgument" do I18n.backend.store_translations('en', {"nonexistant_key" => "%{random_key} also required, so this will fail"}) - expect { I18n.t('nonexistant_key', :hey => "what") }.should raise_exception(I18n::MissingInterpolationArgument) + expect { I18n.t('nonexistant_key', :hey => "what") }.to raise_exception(I18n::MissingInterpolationArgument) end end end diff --git a/spec/lib/postzord/dispatcher_spec.rb b/spec/lib/postzord/dispatcher_spec.rb index 9f70e84f9..b93f5d416 100644 --- a/spec/lib/postzord/dispatcher_spec.rb +++ b/spec/lib/postzord/dispatcher_spec.rb @@ -42,7 +42,7 @@ describe Postzord::Dispatcher do it 'raises and gives you a helpful message if the object can not federate' do expect { Postzord::Dispatcher.build(alice, []) - }.should raise_error /Diaspora::Federated::Base/ + }.to raise_error /Diaspora::Federated::Base/ end end diff --git a/spec/lib/salmon/slap_spec.rb b/spec/lib/salmon/slap_spec.rb index 91d854bda..8b4c2415f 100644 --- a/spec/lib/salmon/slap_spec.rb +++ b/spec/lib/salmon/slap_spec.rb @@ -51,7 +51,7 @@ describe Salmon::Slap do parsed_salmon.author_id = 'tom@tom.joindiaspora.com' expect { parsed_salmon.author.public_key - }.should raise_error "did you remember to async webfinger?" + }.to raise_error "did you remember to async webfinger?" end end diff --git a/spec/models/app_config_spec.rb b/spec/models/app_config_spec.rb index 7abe760e0..25a34d98c 100644 --- a/spec/models/app_config_spec.rb +++ b/spec/models/app_config_spec.rb @@ -32,7 +32,7 @@ describe AppConfig do it "prints an error message and exits" do expect { AppConfig.load! - }.should raise_error SystemExit + }.to raise_error SystemExit $stderr.rewind $stderr.string.chomp.should_not be_blank @@ -57,7 +57,7 @@ describe AppConfig do expect { AppConfig.load! - }.should raise_error SystemExit + }.to raise_error SystemExit $stderr.rewind $stderr.string.should include("haven't set up") @@ -69,7 +69,7 @@ describe AppConfig do expect { AppConfig.load! - }.should raise_error SystemExit + }.to raise_error SystemExit $stderr.rewind $stderr.string.should include("file format has changed") @@ -82,7 +82,7 @@ describe AppConfig do expect { AppConfig.load! - }.should raise_error SystemExit + }.to raise_error SystemExit $stderr.rewind $stderr.string.should include("file format has changed") diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 57605223a..a20616bb0 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -246,13 +246,13 @@ describe Photo do it 'is deleted with parent status message' do expect { @status_message.destroy - }.should change(Photo, :count).by(-1) + }.to change(Photo, :count).by(-1) end it 'will delete parent status message if message is otherwise empty' do expect { @photo2.destroy - }.should change(StatusMessage, :count).by(-1) + }.to change(StatusMessage, :count).by(-1) end it 'will not delete parent status message if message had other content' do @@ -263,7 +263,7 @@ describe Photo do expect { @photo2.status_message.reload @photo2.destroy - }.should_not change(StatusMessage, :count) + }.to_not change(StatusMessage, :count) end end end diff --git a/spec/models/reshare_spec.rb b/spec/models/reshare_spec.rb index 3d92bc007..5234498eb 100644 --- a/spec/models/reshare_spec.rb +++ b/spec/models/reshare_spec.rb @@ -139,7 +139,7 @@ describe Reshare do expect{ reshare.destroy - }.should_not raise_error + }.to_not raise_error end end diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 31d7b07d3..1a1e1fbe3 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -205,7 +205,7 @@ STR expect{ @sm.create_mentions - }.should_not raise_error + }.to_not raise_error end end describe '#mentioned_people' do diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index b68b927c9..08e70ba9c 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -18,7 +18,7 @@ describe User do expect{ user.reload.encryption_key - }.should_not raise_error + }.to_not raise_error end end