muster 0.0.5 → 0.0.6
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/muster/results.rb +9 -1
- data/lib/muster/version.rb +1 -1
- data/spec/muster/results_spec.rb +4 -2
- metadata +1 -1
data/lib/muster/results.rb
CHANGED
@@ -160,7 +160,15 @@ module Muster
|
|
160
160
|
value = self[meth]
|
161
161
|
|
162
162
|
if value.kind_of?(Hash)
|
163
|
-
value
|
163
|
+
value.instance_eval do
|
164
|
+
def method_missing(meth, *args, &block)
|
165
|
+
if self.has_key?(meth)
|
166
|
+
return self.fetch(meth)
|
167
|
+
end
|
168
|
+
|
169
|
+
super
|
170
|
+
end
|
171
|
+
end
|
164
172
|
end
|
165
173
|
|
166
174
|
return value
|
data/lib/muster/version.rb
CHANGED
data/spec/muster/results_spec.rb
CHANGED
@@ -92,12 +92,14 @@ describe Muster::Results do
|
|
92
92
|
results.name.should eq [1, 2, 3]
|
93
93
|
end
|
94
94
|
|
95
|
-
it 'returns
|
95
|
+
it 'returns a Hash with method missing dot notation' do
|
96
96
|
data[:pagination] = {:page => 1, :per_page => 10}
|
97
97
|
|
98
|
-
results.pagination.should
|
98
|
+
results.pagination.should be_an_kind_of(Hash)
|
99
99
|
results.pagination.page.should eq 1
|
100
100
|
results.pagination.per_page.should eq 10
|
101
|
+
results.pagination[:page].should eq 1
|
102
|
+
results.pagination[:per_page].should eq 10
|
101
103
|
end
|
102
104
|
end
|
103
105
|
|