Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: more test cleaning #64

Merged
merged 1 commit into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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