Skip to content

Commit

Permalink
Add more integration tests;
Browse files Browse the repository at this point in the history
Test geometry alignment.
  • Loading branch information
gavinlaking committed May 21, 2016
1 parent 397b648 commit 1501e8a
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 0 deletions.
177 changes: 177 additions & 0 deletions integrations/dsl_app_geometry_005.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
#!/usr/bin/env ruby

# frozen_string_literal: true

require 'bundler/setup'
require 'vedeu'

TESTCASE = 'dsl_app_geometry_005'

class DSLApp

Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }

Vedeu.configure do
debug!
log Dir.tmpdir + '/vedeu_views_dsl.log'
renderers [
Vedeu::Renderers::Terminal.new(
filename: Dir.tmpdir + "/#{TESTCASE}.out",
write_file: true)
]
run_once!
standalone!

height 25
width 80
end

Vedeu.interface :top_left_view do
border do
title 'Top Left'
end
geometry do
align vertical: :top, horizontal: :left, width: 20, height: 4
end
end

Vedeu.interface :top_centre_view do
border do
title 'Top Centre'
end
geometry do
align vertical: :top, horizontal: :centre, width: 20, height: 4
end
end

Vedeu.interface :top_right_view do
border do
title 'Top Right'
end
geometry do
align vertical: :top, horizontal: :right, width: 20, height: 4
end
end

Vedeu.interface :middle_left_view do
border do
title 'Middle Left'
end
geometry do
align vertical: :middle, horizontal: :left, width: 20, height: 4
end
end

Vedeu.interface :middle_centre_view do
border do
title 'Middle Centre'
end
geometry do
align vertical: :middle, horizontal: :centre, width: 20, height: 4
end
end

Vedeu.interface :middle_right_view do
border do
title 'Middle Right'
end
geometry do
align vertical: :middle, horizontal: :right, width: 20, height: 4
end
end

Vedeu.interface :bottom_left_view do
border do
title 'Bottom Left'
end
geometry do
align vertical: :bottom, horizontal: :left, width: 20, height: 4
end
end

Vedeu.interface :bottom_centre_view do
border do
title 'Bottom Centre'
end
geometry do
align vertical: :bottom, horizontal: :centre, width: 20, height: 4
end
end

Vedeu.interface :bottom_right_view do
border do
title 'Bottom Right'
end
geometry do
align vertical: :bottom, horizontal: :right, width: 20, height: 4
end
end

Vedeu.render do
view(:top_left_view) do
lines do
line "top left"
end
end

view(:top_centre_view) do
lines do
line "top centre"
end
end

view(:top_right_view) do
lines do
line "top right"
end
end

view(:middle_left_view) do
lines do
line "middle left"
end
end

view(:middle_centre_view) do
lines do
line "middle centre"
end
end

view(:middle_right_view) do
lines do
line "middle right"
end
end

view(:bottom_left_view) do
lines do
line "bottom left"
end
end

view(:bottom_centre_view) do
lines do
line "bottom centre"
end
end

view(:bottom_right_view) do
lines do
line "bottom right"
end
end
end

def self.start(argv = ARGV)
Vedeu::Launcher.execute!(argv)
end

end # DSLApp

Vedeu.timer('Test') do
DSLApp.start
end

load File.dirname(__FILE__) + '/test_runner.rb'
TestRunner.result(TESTCASE, __FILE__)
1 change: 1 addition & 0 deletions integrations/expected/dsl_app_geometry_005.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(0l(B(0q(B Top Left (0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0k(B(0l(B(0q(B Top Centre (0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0k(B(0l(B(0q(B Top Right (0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0k(B(0x(Btop left(0x(B(0x(Btop centre(0x(B(0x(Btop right(0x(B(0x(B(0x(B(0x(B(0x(B(0x(B(0x(B(0m(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0j(B(0m(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0j(B(0m(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0j(B(0l(B(0q(B Middle Left (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(0q(B(0q(B(0q(B(0q(B(0q(B(0j(B
1 change: 1 addition & 0 deletions integrations/test_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ cd "$(dirname "$0")"
./dsl_app_geometry_002.rb
./dsl_app_geometry_003.rb
./dsl_app_geometry_004.rb
./dsl_app_geometry_005.rb

# Failing
# ./dsl_app_017.rb

0 comments on commit 1501e8a

Please sign in to comment.