Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

spec fixes

  • Loading branch information...
commit 880b4834d0597f8c77752705a481a7de60edd945 1 parent 5d8a0eb
Robert Sosinski authored
View
2  lib/hstore_serializer/hash.rb
@@ -24,4 +24,4 @@ def to_hstore
def from_hstore
self
end
-end
+end
View
4 lib/hstore_serializer/string.rb
@@ -8,7 +8,7 @@ def to_hstore
# Validates the hstore format. Valid formats are:
# * An empty string
# * A string like %("foo"=>"bar"). I'll call it a "double quoted hstore format".
- # * A string like %(foo=>bar). Postgres doesn't emit this but it does accept it as input, we should accept any input Postgres does
+ # * A string like %(foo=>bar). Postgres doesn't emit this but it does accept it as input, we should accept any input Postgres does.
def valid_hstore?
pair = hstore_pair
!!match(/^\s*(#{pair}\s*(,\s*#{pair})*)?\s*$/)
@@ -38,4 +38,4 @@ def hstore_pair
string = /(#{quoted_string}|#{unquoted_string})/
/#{string}\s*=>\s*#{string}/
end
-end
+end
View
14 spec/hstore_serializer_spec.rb
@@ -40,7 +40,7 @@
it "should preserve null values on store" do
# NULL=>b will be interpreted as the string pair "NULL"=>"b"
- {'a' => nil,nil=>'b'}.to_hstore.should eq(%q(a=>NULL,NULL=>b))
+ {'a' => nil, nil=>'b'}.to_hstore.should eq(%q(a=>NULL,NULL=>b))
end
it "should preserve null values on load" do
@@ -55,11 +55,11 @@
end
it "should unquote keys correctly with single quotes" do
- "\"'a'\"=>\"a\"". from_hstore.should eq({"'a'" => "a"})
- '\=a=>q=w'. from_hstore.should eq({"=a"=>"q=w"})
- '"=a"=>q\=w'. from_hstore.should eq({"=a"=>"q=w"});
- '"\"a"=>q>w'. from_hstore.should eq({"\"a"=>"q>w"});
- '\"a=>q"w'. from_hstore.should eq({"\"a"=>"q\"w"})
+ "\"'a'\"=>\"a\"".from_hstore.should eq({"'a'" => "a"})
+ '\=a=>q=w'.from_hstore.should eq({"=a"=>"q=w"})
+ '"=a"=>q\=w'.from_hstore.should eq({"=a"=>"q=w"});
+ '"\"a"=>q>w'.from_hstore.should eq({"\"a"=>"q>w"});
+ '\"a=>q"w'.from_hstore.should eq({"\"a"=>"q\"w"})
end
it "should quote keys and values correctly with combinations of single and double quotes" do
@@ -78,4 +78,4 @@
''.from_hstore.should eq({})
' '.from_hstore.should eq({})
end
-end
+end
View
4 spec/spec_helper.rb
@@ -1,9 +1,9 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-require 'active_record_hstore_serializer'
+require 'hstore_serializer'
require 'rspec'
require 'rspec/autorun'
RSpec.configure do |config|
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.