diff --git a/Gemfile.lock b/Gemfile.lock index 4acb65ce67dd3861359d08665ce46ec05322023f..5d536de1b6bb4c3b59d5ff9d38544489328fd103 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 0fe07a91c604d72df34dca088827f603bc378ba4..de1f81663af669697483ace380aeadfd0191f54b 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 f963e9963d3cfafbc42ffbbedd0f70af00e53114..dfaddc41377e38d7b33f6f82e8c1741ac1a9a46c 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 9b400fa822d2330e88d1359b17d2521a2a270e03..b9ac6b47894464699a11c15199c6262115438840 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 2effdac35fbf5f48b18c727f20cf4d0066cefd1e..0e7614ab3e64b135f6d8ec0d33510eeaba948e5b 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 15804b00bb915623aa032a9cc850c29c95b9b2cf..f35eda7ba0566b994f227969a1d73e67eff68ee8 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 110c1d5007085c92b38a7a393335f2aa1776f2c6..58671cce28ac9fcc3d36089862dd8dfd0f090538 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 bb5191c1bb2a56066c8e74fd3fef691cd350003a..244512847d2d1834da8e585c58f7c0cb05b7403f 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 9f70e84f9fe4f46dd03cfc3d628366982cf94a15..b93f5d41636d72856fd131c9dc7e93819862ca14 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 91d854bda222ecb5315d36143be1c252b123a41f..8b4c2415f9c8c043d6d1e70a08ed542d510c6a8d 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 7abe760e0a5112f955ecb5a44d872c1526dcde0d..25a34d98c8bff63dacddcac910b9da0e5c2eac7e 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 57605223a4b8dcf85587df4f0c9a1a97c69f60cd..a20616bb0d6d76d37cae985f4afe7b1c6e930414 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 3d92bc0071e4f23d6956a8e8ba93910da8a76a2a..5234498eb168770cc4d85665b81252cda95a6d3d 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 31d7b07d3ea51e078dfc0741d207a66cc188ef13..1a1e1fbe364f18400d7320102d67361e09d9b2b8 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 b68b927c975143b16df42d990fdb3a8a8223bfee..08e70ba9c8bd7ece1e2728686486ec58d4b4e448 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