Skip to content

Commit

Permalink
Merge pull request #64 from seuros/fresher
Browse files Browse the repository at this point in the history
chore: more test cleaning
  • Loading branch information
apotonick authored May 28, 2024
2 parents acadd20 + 703de39 commit f2dedc7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/activity_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

class ActivityTest < Minitest::Spec
it "provides {#inspect}" do
expect(Trailblazer::Activity.new({}).inspect.gsub(/0x\w+/, "0x")).must_equal %{#<Trailblazer::Activity:0x>}
assert_equal Trailblazer::Activity.new({}).inspect.gsub(/0x\w+/, "0x"), %{#<Trailblazer::Activity:0x>}
end

it "can start with any task" do
skip
signal, (options,) = activity.([{}], start_task: L)

expect(signal).must_equal activity.outputs[:success].signal
expect(options.inspect).must_equal %{{:L=>1}}
assert_equal signal, activity.outputs[:success].signal
assert_equal options.inspect, %{{:L=>1}}
end

it "exposes {#to_h}" do
Expand All @@ -27,7 +27,7 @@ class ActivityTest < Minitest::Spec

# TODO: test {to_h} properly
it "exposes {:data} attributes in {#to_h}" do
expect(bc.to_h[:nodes].values[1][:data].inspect).must_equal %{{:additional=>true}}
assert_equal bc.to_h[:nodes].values[1][:data].inspect, %{{:additional=>true}}
end

it "{:activity}" do
Expand Down Expand Up @@ -72,7 +72,7 @@ class ActivityTest < Minitest::Spec
_signal, (ctx,) = activity.([[], {}])

# each task receives the containing {:activity}
expect(ctx).must_equal [activity, nested_activity, nested_activity, nested_activity, nested_activity, activity, activity]
assert_equal ctx, [activity, nested_activity, nested_activity, nested_activity, nested_activity, activity, activity]
end

it "allows overriding {Activity.call} (this is needed in trb-pro)" do
Expand Down

0 comments on commit f2dedc7

Please sign in to comment.