Skip to content

Commit

Permalink
New integration test for shared variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Arian Weber authored and Arian Weber committed Jan 26, 2024
1 parent b881e1d commit 00e4e4c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions integration_tests/ruby_dsl/009_shared_variables.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
model :TestAction do

graph :Car do
var distance_to_wall: (0..10), init: 0

states :DrivingRelentlessly

transition :DrivingRelentlessly => :DrivingRelentlessly do
precon "distance_to_wall > 0"
action "distance_to_wall := distance_to_wall - 1"
end
end
graph :CrashDetector do
states :no_crash, :crash, init: :no_crash

transition :no_crash => :crash do
guard "distance_to_wall == 0"
end

end

specify "The car" do
it "starts out driving" => :"CrashDetector == no_crash && Car == DrivingRelentlessly"
it "crashes horribly" => :"F CrashDetector == crash"
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

RSpec.describe PgTools::Transform::HashTransformation do

test_files = Dir[File.join(PgTools.root, "integration_tests", "ruby_dsl", "*.rb")]
test_files = Dir[File.join(PgTools.root, "integration_tests", "ruby_dsl", "*.rb")].sort

test_files.each { |test_file|
it "round trips for '#{File.basename(test_file)}'" do
Expand Down

0 comments on commit 00e4e4c

Please sign in to comment.