Skip to content

Commit

Permalink
remove parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
seuros committed May 28, 2024
1 parent 330b34f commit 7a9e4e5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
32 changes: 16 additions & 16 deletions test/circuit_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ class CircuitTest < Minitest::Spec

last_signal, (ctx, i, j, *bla) = circuit.([ctx, 1, 2], task: Start)

assert_equal (ctx.inspect), %{{:start=>1, :a=>2, :b=>3, :_end=>4}}
assert_equal (last_signal), "the end"
assert_equal (i), 1
assert_equal (j), 2
assert_equal (bla), []
assert_equal ctx.inspect, %{{:start=>1, :a=>2, :b=>3, :_end=>4}}
assert_equal last_signal, "the end"
assert_equal i, 1
assert_equal j, 2
assert_equal bla, []

# ---

Expand All @@ -33,7 +33,7 @@ class CircuitTest < Minitest::Spec

last_signal, (ctx, i, j, *bla) = circuit.([ctx, flow_options, 2], task: Start, runner: MyRunner)

assert_equal (flow_options), { stack: [Start, A, B, End] }
assert_equal flow_options, { stack: [Start, A, B, End] }
end

MyRunner = ->(task, args, **circuit_options) do
Expand Down Expand Up @@ -76,11 +76,11 @@ class CircuitTest < Minitest::Spec

last_signal, (ctx, i, j, *bla) = outer.([ctx, {}, 2], task: Start)

assert_equal (ctx.inspect), %{{:start=>1, :a=>2, :c=>6, :_end=>4, :b=>3}}
assert_equal (last_signal), "the end"
assert_equal (i),({})
assert_equal (j), 2
assert_equal (bla), []
assert_equal ctx.inspect, %{{:start=>1, :a=>2, :c=>6, :_end=>4, :b=>3}}
assert_equal last_signal, "the end"
assert_equal i,({})
assert_equal j, 2
assert_equal bla, []
end

it "allows using a custom :runner" do
Expand All @@ -89,11 +89,11 @@ class CircuitTest < Minitest::Spec

last_signal, (ctx, flow_options, j, *bla) = outer.([ctx, flow_options, 2], task: Start, runner: MyRunner)

assert_equal (ctx.inspect), %{{:start=>1, :a=>2, :c=>6, :_end=>4, :b=>3}}
assert_equal (last_signal), "the end"
assert_equal (flow_options), { stack: [Start, A, nestable, Start, C, End, B, End], runner: MyRunner }
assert_equal (j), 2
assert_equal (bla), []
assert_equal ctx.inspect, %{{:start=>1, :a=>2, :c=>6, :_end=>4, :b=>3}}
assert_equal last_signal, "the end"
assert_equal flow_options, { stack: [Start, A, nestable, Start, C, End, B, End], runner: MyRunner }
assert_equal j, 2
assert_equal bla, []
end

let(:wicked_circuit) do
Expand Down
6 changes: 3 additions & 3 deletions test/intermediate_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,21 +164,21 @@ def implementation(c_extensions)

schema = Inter::Compiler.(intermediate, implementation([ext_a, ext_b, ext_d, ext_e]))

assert_equal (schema[:config].to_h.inspect), %{{:wrap_static=>{}, :a=>\"bla\", :b=>\"blubb\", :C=>1, :e=>2}}
assert_equal schema[:config].to_h.inspect, %{{:wrap_static=>{}, :a=>\"bla\", :b=>\"blubb\", :C=>1, :e=>2}}
end

# {Implementation.call()} allows to pass {config} data
describe "{Implementation.call()}" do
it "accepts {config_merge:} data that is merged into {config}" do
schema = Inter::Compiler.(intermediate, implementation([]), config_merge: {beer: "yes"})

assert_equal (schema[:config].to_h.inspect), %{{:wrap_static=>{}, :beer=>\"yes\"}}
assert_equal schema[:config].to_h.inspect, %{{:wrap_static=>{}, :beer=>\"yes\"}}
end

it "{:config_merge} overrides values in {default_config}" do
schema = Inter::Compiler.(intermediate, implementation([]), config_merge: {beer: "yes", wrap_static: "yo"})

assert_equal (schema[:config].to_h.inspect), %{{:wrap_static=>"yo", :beer=>\"yes\"}}
assert_equal schema[:config].to_h.inspect, %{{:wrap_static=>"yo", :beer=>\"yes\"}}
end
end
end
Expand Down

0 comments on commit 7a9e4e5

Please sign in to comment.