spec/syntax/nodes/test_attribute.rb in finitio-0.10.0 vs spec/syntax/nodes/test_attribute.rb in finitio-0.11.1
- old
+ new
@@ -32,10 +32,22 @@
expect(compiled.type).to be_a(BuiltinType)
expect(compiled.type.ruby_type).to be(Integer)
expect(compiled).not_to be_required
end
end
+
+ context 'when using dashes in attribute name' do
+ let(:input){ 'created-at : .Integer' }
+
+ it 'works' do
+ expect(compiled).to be_a(Attribute)
+ expect(compiled.name).to eq(:"created-at")
+ expect(compiled.type).to be_a(BuiltinType)
+ expect(compiled.type.ruby_type).to be(Integer)
+ expect(compiled).to be_required
+ end
+ end
end
describe 'AST' do
let(:ast){
subject.to_ast
@@ -58,8 +70,8 @@
it{ expect(ast).to eq([:attribute, "_", [:builtin_type, "Integer"]]) }
end
end
-
+
end
end