spec/blobby/store_behaviour.rb in blobby-1.0.1 vs spec/blobby/store_behaviour.rb in blobby-1.1.0

- old
+ new

@@ -1,7 +1,9 @@ # encoding: UTF-8 +require "spec_helper" + require "rspec" module Blobby module Store end @@ -96,19 +98,21 @@ if "Strings".respond_to?(:encoding) context "for UTF-8 content" do - let(:content) { "SN☃WMAN" } + let(:content) { "SN☃WMAN".freeze } before do stored_object.write(content) end describe "#read" do it "returns binary data" do - expect(stored_object.read.encoding.name).to eq("ASCII-8BIT") + stored_content = stored_object.read + expect(stored_content.encoding.name).to eq("ASCII-8BIT") + expect(stored_content.force_encoding("UTF-8")).to eq(content) end end end