diff --git a/config.yml.example b/config.yml.example index f0ed36d..b4e3ac3 100644 --- a/config.yml.example +++ b/config.yml.example @@ -32,6 +32,11 @@ test: cs_binaries: rs.binaries.test authorizations: rs_authorizations_test opslog: rs_opslog_test + swift: + host: "https://swift.example.com" + redis: + host: localhost + port: 6379 staging: <<: *defaults diff --git a/spec/riak/directories_spec.rb b/spec/riak/directories_spec.rb index 6551a7f..eea4f82 100644 --- a/spec/riak/directories_spec.rb +++ b/spec/riak/directories_spec.rb @@ -251,7 +251,7 @@ describe "Directories" do context "charset given in content-type header" do before do header "Content-Type", "image/jpeg; charset=binary" - filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg") + filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg") @image = File.open(filename, "r").read put "/jimmy/tasks/jaypeg.jpg", @image end @@ -273,7 +273,7 @@ describe "Directories" do context "no charset in content-type header" do before do header "Content-Type", "image/jpeg" - filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg") + filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg") @image = File.open(filename, "r").read put "/jimmy/tasks/jaypeg.jpg", @image end diff --git a/spec/riak/riak_spec.rb b/spec/riak/riak_spec.rb index 40a457a..19c2d69 100644 --- a/spec/riak/riak_spec.rb +++ b/spec/riak/riak_spec.rb @@ -446,7 +446,7 @@ describe "App with Riak backend" do context "binary charset in content-type header" do before do header "Content-Type", "image/jpeg; charset=binary" - filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg") + filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg") @image = File.open(filename, "r").read put "/jimmy/documents/jaypeg", @image end @@ -502,7 +502,7 @@ describe "App with Riak backend" do context "overwriting existing file with same file" do before do header "Content-Type", "image/jpeg; charset=binary" - filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg") + filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg") @image = File.open(filename, "r").read put "/jimmy/documents/jaypeg", @image end @@ -518,7 +518,7 @@ describe "App with Riak backend" do context "overwriting existing file with different file" do before do header "Content-Type", "image/jpeg; charset=binary" - filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg") + filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg") @image = File.open(filename, "r").read put "/jimmy/documents/jaypeg", @image+"foo" end @@ -540,7 +540,7 @@ describe "App with Riak backend" do context "no binary charset in content-type header" do before do header "Content-Type", "image/jpeg" - filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg") + filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg") @image = File.open(filename, "r").read put "/jimmy/documents/jaypeg", @image end @@ -705,7 +705,7 @@ describe "App with Riak backend" do context "binary data" do before do header "Content-Type", "image/jpeg; charset=binary" - filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg") + filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg") @image = File.open(filename, "r").read put "/jimmy/documents/jaypeg", @image diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8cec109..4975f52 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -33,13 +33,15 @@ end alias context describe -def redis - @redis ||= Redis.new(host: app.settings.redis["host"], port: app.settings.redis["port"]) -end +if app.settings.respond_to? :redis + def redis + @redis ||= Redis.new(host: app.settings.redis["host"], port: app.settings.redis["port"]) + end -def purge_redis - redis.keys("rs_*").each do |key| - redis.del key + def purge_redis + redis.keys("rs_*").each do |key| + redis.del key + end end end