lib/gobstones/batch.rb in mumuki-gobstones-runner-1.6.1 vs lib/gobstones/batch.rb in mumuki-gobstones-runner-1.7.0
- old
+ new
@@ -25,13 +25,15 @@
base = example_base_json(example)
expected_board ? base.merge(extraBoard: expected_board) : base
end
def example_base_json(example)
- {initialBoard: example[:preconditions][:initial_board],
- originalCode: content,
- code: example_code(example),
- extraCode: extra}
+ json = {initialBoard: example[:preconditions][:initial_board],
+ code: example_code(example),
+ extraCode: extra}
+
+ json[:originalCode] = content if json[:code] != content
+ json
end
def example_code(example)
Gobstones::ExampleCodeBuilder.new(content, example, options).build
end