Skip to content

Commit

Permalink
start structures_test.rb.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Feb 16, 2024
1 parent db69fb4 commit fab714b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/structures_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require "test_helper"

class StructuresTest < Minitest::Spec
it "Collaboration::Positions" do
activity_a = "A"
suspend_a = "suspend:a"
activity_b = "B"
suspend_b = "suspend:b"

#@ Position.new
position_a = Trailblazer::Workflow::Collaboration::Position.new(activity_a, suspend_a)
position_b = Trailblazer::Workflow::Collaboration::Position.new(activity_b, suspend_b)

#@ Position#to_a
assert_equal position_a.to_a.inspect, %(["A", "suspend:a"])

#@ Positions.new
positions = Trailblazer::Workflow::Collaboration::Positions.new([position_a, position_b])

#@ Positions.collect automatically decomposes each iterated position.
assert_equal positions.collect { |activity, task| [activity, task] }.inspect, %([[\"A\", \"suspend:a\"], [\"B\", \"suspend:b\"]])
end
end

0 comments on commit fab714b

Please sign in to comment.