json_schema_tools 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -99,7 +99,7 @@ module SchemaTools
99
99
  obj_val = obj.send(match[0]) if obj.respond_to?(match[0])
100
100
  replaces << ["{#{match[0]}}", obj_val] if obj_val
101
101
  end
102
- replaces.each {|r| href.gsub!(r[0], r[1])}
102
+ replaces.each {|r| href.gsub!(r[0], "#{r[1]}")}
103
103
  href = "#{opts[:base_url]}/#{href}" if opts[:base_url]
104
104
 
105
105
  links << { 'rel' => link['rel'],
@@ -1,3 +1,3 @@
1
1
  module SchemaTools
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
@@ -179,8 +179,9 @@ describe SchemaTools::Hash do
179
179
  end
180
180
 
181
181
  it 'should replace placeholders' do
182
+ client.id = 123
182
183
  hash = SchemaTools::Hash.from_schema(client, base_url: 'http://json-hell.com')
183
- hash['links'].last['href'].should == 'http://json-hell.com/clients/SomeID/Peter'
184
+ hash['links'].last['href'].should == 'http://json-hell.com/clients/123/Peter'
184
185
  end
185
186
 
186
187
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_schema_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: