diff --git a/spec/mosaik/syntax/tree_spec.rb b/spec/mosaik/syntax/tree_spec.rb index 0717383..f3df62f 100644 --- a/spec/mosaik/syntax/tree_spec.rb +++ b/spec/mosaik/syntax/tree_spec.rb @@ -53,8 +53,7 @@ tree["Foo::Bar"] tree["Foo::Baz::Bat"] - constants = [] - tree.each { |constant| constants << constant.name } + constants = tree.map(&:name) expect(constants).to eq ["Foo", "Foo::Bar", "Foo::Baz", "Foo::Baz::Bat"] end