@@ -127,10 +127,13 @@ foo =
127127 assert .error (function () return bundle [" apple" ]:format () end )
128128 end )
129129
130- pending (' attributes can be accessed as properties' , function ()
130+ it (' attributes can be accessed as properties' , function ()
131131 assert .same (" qux" , bundle [" bar.bax" ]())
132+ assert .same (" qux" , en [" bar.bax" ]())
132133 assert .same (" qux" , bundle .bar [" bax" ]())
134+ assert .same (" qux" , en .bar [" bax" ]())
133135 assert .same (" qux" , bundle .bar .bax ())
136+ assert .same (" qux" , en .bar .bax ())
134137 end )
135138
136139 it (' preserves messages when messages are added' , function ()
@@ -157,22 +160,34 @@ foo =
157160 assert .same (" baz" , bundle .bar ())
158161 assert .same (" baz" , en .bar ())
159162 assert .same (" baz" , bundle :format (" bar" ))
163+ assert .same (" baz" , en :format (" bar" ))
160164 assert .same (" qux" , bundle :get_message (" bar" ):get_attribute (" bax" )())
161- -- assert.same("qux", bundle["bar.bax"]())
162- -- assert.same("qux", bundle.bar.bax())
165+ assert .same (" qux" , en :get_message (" bar" ):get_attribute (" bax" )())
166+ assert .same (" qux" , bundle [" bar.bax" ]())
167+ assert .same (" qux" , en [" bar.bax" ]())
168+ assert .same (" qux" , bundle .bar .bax ())
169+ assert .same (" qux" , en .bar .bax ())
163170 bundle :add_messages (" aa = bb" )
164- -- assert.same("qux", bundle["bar.bax"]())
165- -- assert.same("qux", bundle.bar:get_attribute("bax")())
166171 assert .same (" baz" , bundle .bar ())
167172 assert .same (" baz" , en .bar ())
168173 assert .same (" baz" , bundle :format (" bar" ))
174+ assert .same (" baz" , en :format (" bar" ))
169175 assert .same (" qux" , bundle :get_message (" bar" ):get_attribute (" bax" )())
176+ assert .same (" qux" , en :get_message (" bar" ):get_attribute (" bax" )())
177+ assert .same (" qux" , bundle [" bar.bax" ]())
178+ assert .same (" qux" , en [" bar.bax" ]())
179+ -- TODO Penlight hack doesn't work around this?
180+ -- assert.same("qux", bundle.bar.bax())
181+ -- assert.same("qux", en.bar.bax())
170182 bundle :add_messages (" bar = rebar" )
171183 assert .same (" rebar" , bundle .bar ())
172184 assert .same (" rebar" , en .bar ())
173185 assert .same (" rebar" , bundle :format (" bar" ))
186+ assert .same (" rebar" , en :format (" bar" ))
174187 assert .error (function () return bundle :get_message (" bar" ):get_attribute (" bax" )() end )
175- -- assert.same("qux", bundle.bar.bax())
188+ assert .error (function () return en :get_message (" bar" ):get_attribute (" bax" )() end )
189+ assert .error (function () return bundle .bar .bax () end )
190+ assert .error (function () return en .bar .bax () end )
176191 end )
177192
178193 it (' can be called' , function ()
0 commit comments