From 16dcc56fbadf8d174df29eb175697d95e354dc0e Mon Sep 17 00:00:00 2001 From: Garret Alfert Date: Fri, 29 Jan 2016 15:16:24 +0100 Subject: [PATCH] No need to stub has_name_collision? anymore --- spec/swift/app_spec.rb | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/spec/swift/app_spec.rb b/spec/swift/app_spec.rb index 9d20293..6b2a876 100644 --- a/spec/swift/app_spec.rb +++ b/spec/swift/app_spec.rb @@ -26,10 +26,8 @@ describe "App" do it "creates the metadata object in redis" do put_stub = OpenStruct.new(headers: {etag: "bla"}) - RemoteStorage::Swift.stub_any_instance :has_name_collision?, false do - RestClient.stub :put, put_stub do - put "/phil/food/aguacate", "si" - end + RestClient.stub :put, put_stub do + put "/phil/food/aguacate", "si" end metadata = redis.hgetall "rs_meta:phil:food/aguacate" @@ -41,11 +39,9 @@ describe "App" do it "creates the directory objects metadata in redis" do put_stub = OpenStruct.new(headers: {etag: "bla"}) - RemoteStorage::Swift.stub_any_instance :has_name_collision?, false do - RestClient.stub :put, put_stub do - put "/phil/food/aguacate", "si" - put "/phil/food/camaron", "yummi" - end + RestClient.stub :put, put_stub do + put "/phil/food/aguacate", "si" + put "/phil/food/camaron", "yummi" end metadata = redis.hgetall "rs_meta:phil:/" @@ -119,11 +115,9 @@ describe "App" do header "Authorization", "Bearer amarillo" put_stub = OpenStruct.new(headers: {etag: "bla"}) - RemoteStorage::Swift.stub_any_instance :has_name_collision?, false do - RestClient.stub :put, put_stub do - put "/phil/food/aguacate", "si" - put "/phil/food/camaron", "yummi" - end + RestClient.stub :put, put_stub do + put "/phil/food/aguacate", "si" + put "/phil/food/camaron", "yummi" end end @@ -205,12 +199,10 @@ describe "App" do header "Authorization", "Bearer amarillo" put_stub = OpenStruct.new(headers: {etag: "bla"}) - RemoteStorage::Swift.stub_any_instance :has_name_collision?, false do - RestClient.stub :put, put_stub do - put "/phil/food/aguacate", "si" - put "/phil/food/camaron", "yummi" - put "/phil/food/desunyos/bolon", "wow" - end + RestClient.stub :put, put_stub do + put "/phil/food/aguacate", "si" + put "/phil/food/camaron", "yummi" + put "/phil/food/desunyos/bolon", "wow" end end