spec/graph_ql/parser/parser_spec.rb in graphql-0.1.0 vs spec/graph_ql/parser/parser_spec.rb in graphql-0.2.0
- old
+ new
@@ -36,11 +36,11 @@
it 'parses operation definitions' do
assert(parser.operation_definition.parse_with_debug(%|{id, name, ...people}|), "just a selection")
assert(parser.operation_definition.parse_with_debug(%|query personStuff {id, name, ...people, ... stuff}|), "named fetch")
assert(parser.operation_definition.parse_with_debug(%|query personStuff @flagDirective {id, name, ...people}|), "with a directive")
- assert(parser.operation_definition.parse_with_debug(%|mutation changeStuff($stuff: Int = 1, $things: [Boolean]!) {id, name, ...people}|), "mutation with arguments")
+ assert(parser.operation_definition.parse_with_debug(%|mutation changeStuff($stuff: Int = 1, $things: [SomeType]!) {id, name, ...people}|), "mutation with arguments")
end
it 'parses fragment definitions' do
assert(parser.fragment_definition.parse_with_debug(%|fragment nutritionFacts on Food { fat, sodium, carbohydrates, vitamins { a, b } }|))
assert(parser.fragment_definition.parse_with_debug(%|fragment nutritionFacts on Food @directive(key: 1) { fat, sodium, carbohydrates, vitamins { a, b } }|), 'gets directives')
@@ -83,10 +83,12 @@
end
it 'gets floats' do
assert(parser.value.parse_with_debug("1.14"), 'no exponent')
assert(parser.value.parse_with_debug("6.7e-9"), 'negative exponent')
+ assert(parser.value.parse_with_debug("6.7e+9"), 'positive exponent')
assert(parser.value.parse_with_debug("0.4e12"), 'exponent')
+ assert(parser.value.parse_with_debug("6.7E+9"), 'big e')
end
it 'gets booleans' do
assert(parser.value.parse_with_debug("true"))
assert(parser.value.parse_with_debug("false"))