jsonit 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/jsonit/builder.rb +6 -0
- data/lib/jsonit/version.rb +1 -1
- data/spec/jsonit/builder_spec.rb +11 -2
- metadata +2 -2
data/lib/jsonit/builder.rb
CHANGED
data/lib/jsonit/version.rb
CHANGED
data/spec/jsonit/builder_spec.rb
CHANGED
@@ -126,11 +126,10 @@ describe Jsonit::Builder do
|
|
126
126
|
|
127
127
|
it 'does not raise method missing for method with format /^[a-z][a-z0-9]+$/' do
|
128
128
|
[:a, :b, :c].each do |m|
|
129
|
-
expect { json.
|
129
|
+
expect { eval("json.#{m.to_s}") }.to_not raise_error(NoMethodError)
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
133
|
-
|
134
133
|
it 'raises method missing for ending with a "?"' do
|
135
134
|
[:a?, :b?, :c?].each do |m|
|
136
135
|
expect { eval("json.#{m.to_s}") }.to raise_error(NoMethodError)
|
@@ -142,6 +141,16 @@ describe Jsonit::Builder do
|
|
142
141
|
expect { eval("json.#{m.to_s}") }.to raise_error(NoMethodError)
|
143
142
|
end
|
144
143
|
end
|
144
|
+
|
145
|
+
it 'ignores #encode_json' do
|
146
|
+
json.encode_json
|
147
|
+
json.to_json.should_not match /"encode_json"/
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'ignores #as_json' do
|
151
|
+
json.as_json
|
152
|
+
json.to_json.should_not match /"as_json"/
|
153
|
+
end
|
145
154
|
end
|
146
155
|
|
147
156
|
describe "DSL" do
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: jsonit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Klaas Speller
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-29 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|