From 05f54ecbcaa902accc21c9d1152926529302f56c Mon Sep 17 00:00:00 2001 From: Thiago Pradi Date: Fri, 27 Sep 2013 01:27:45 -0300 Subject: [PATCH] Refactor spec code --- spec/octopus/proxy_spec.rb | 4 ++-- spec/support/octopus_helper.rb | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/spec/octopus/proxy_spec.rb b/spec/octopus/proxy_spec.rb index 5feabd67..7bce0691 100644 --- a/spec/octopus/proxy_spec.rb +++ b/spec/octopus/proxy_spec.rb @@ -254,7 +254,7 @@ end it "should save all associated objects on the correct shard" do - subject.should_not raise_error + expect { subject }.to_not raise_error end end @@ -265,7 +265,7 @@ end it "should save all associated objects on the correct shard" do - subject.should_not raise_error + expect { subject }.to_not raise_error end end end diff --git a/spec/support/octopus_helper.rb b/spec/support/octopus_helper.rb index b62b9a8c..0b677439 100644 --- a/spec/support/octopus_helper.rb +++ b/spec/support/octopus_helper.rb @@ -9,13 +9,9 @@ def self.clean_all_shards(shards) BlankModel.using(shard_symbol).connection.execute("DELETE FROM #{tables}") end - if shard_symbol == :alone_shard - %w[ - mmorpg_players - weapons - skills - ].each do |table| - BlankModel.using(shard_symbol).connection.execute("DELETE FROM #{tables}") + if shard_symbol == 'alone_shard' + ['mmorpg_players', 'weapons', 'skills'].each do |table| + BlankModel.using(shard_symbol).connection.execute("DELETE FROM #{table}") end end end