vedeu 0.8.19 → 0.8.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/integrations/342_streams.rb +5 -16
  3. data/integrations/dsl_app_001.rb +8 -19
  4. data/integrations/dsl_app_002.rb +8 -20
  5. data/integrations/dsl_app_003.rb +8 -19
  6. data/integrations/dsl_app_004.rb +8 -19
  7. data/integrations/dsl_app_005.rb +8 -19
  8. data/integrations/dsl_app_006.rb +8 -19
  9. data/integrations/dsl_app_007.rb +8 -19
  10. data/integrations/dsl_app_008.rb +8 -19
  11. data/integrations/dsl_app_009.rb +8 -19
  12. data/integrations/dsl_app_010.rb +8 -19
  13. data/integrations/dsl_app_011.rb +8 -19
  14. data/integrations/dsl_app_012.rb +8 -19
  15. data/integrations/dsl_app_013.rb +8 -19
  16. data/integrations/dsl_app_014.rb +8 -19
  17. data/integrations/dsl_app_015.rb +8 -19
  18. data/integrations/dsl_app_016.rb +8 -19
  19. data/integrations/dsl_app_017.rb +8 -19
  20. data/integrations/dsl_app_018.rb +8 -19
  21. data/integrations/dsl_app_019.rb +8 -19
  22. data/integrations/dsl_app_020.rb +8 -19
  23. data/integrations/dsl_app_021.rb +8 -19
  24. data/integrations/dsl_app_022.rb +8 -19
  25. data/integrations/dsl_app_border_001.rb +8 -19
  26. data/integrations/dsl_app_border_002.rb +8 -19
  27. data/integrations/dsl_app_border_003.rb +8 -19
  28. data/integrations/dsl_app_border_004.rb +8 -19
  29. data/integrations/dsl_app_border_005.rb +8 -19
  30. data/integrations/dsl_app_border_006.rb +58 -0
  31. data/integrations/dsl_app_border_007.rb +58 -0
  32. data/integrations/dsl_app_border_008.rb +57 -0
  33. data/integrations/dsl_app_border_009.rb +57 -0
  34. data/integrations/dsl_app_border_010.rb +57 -0
  35. data/integrations/dsl_app_border_011.rb +57 -0
  36. data/integrations/expected/dsl_app_border_006.out +1 -0
  37. data/integrations/expected/dsl_app_border_007.out +1 -0
  38. data/integrations/expected/dsl_app_border_008.out +1 -0
  39. data/integrations/expected/dsl_app_border_009.out +1 -0
  40. data/integrations/expected/dsl_app_border_010.out +1 -0
  41. data/integrations/expected/dsl_app_border_011.out +1 -0
  42. data/integrations/test_runner.rb +60 -0
  43. data/integrations/test_runner.sh +11 -5
  44. data/lib/vedeu/version.rb +1 -1
  45. data/test/lib/vedeu/repositories/repositories_test.rb +18 -4
  46. data/test/lib/vedeu_test.rb +12 -0
  47. data/test/support/examples/material_colours_app.rb +0 -134
  48. data/vedeu.gemspec +1 -1
  49. metadata +17 -4
@@ -5,6 +5,8 @@
5
5
  require 'bundler/setup'
6
6
  require 'vedeu'
7
7
 
8
+ TESTCASE = 'dsl_app_border_005'
9
+
8
10
  class DSLApp
9
11
 
10
12
  Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
@@ -15,11 +17,11 @@ class DSLApp
15
17
  log '/tmp/vedeu_views_dsl.log'
16
18
  renderers [
17
19
  Vedeu::Renderers::Terminal.new(
18
- filename: '/tmp/dsl_app_border_005.out',
20
+ filename: "/tmp/#{TESTCASE}.out",
19
21
  write_file: true),
20
- # Vedeu::Renderers::JSON.new(filename: '/tmp/dsl_app_border_005.json'),
21
- # Vedeu::Renderers::HTML.new(filename: '/tmp/dsl_app_border_005.html'),
22
- # Vedeu::Renderers::Text.new(filename: '/tmp/dsl_app_border_005.txt'),
22
+ # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
23
25
  ]
24
26
  run_once!
25
27
  standalone!
@@ -39,14 +41,6 @@ class DSLApp
39
41
  end
40
42
  end
41
43
 
42
- def self.actual
43
- File.read('/tmp/dsl_app_border_005.out')
44
- end
45
-
46
- def self.expected
47
- File.read(File.expand_path('../expected/dsl_app_border_005.out', __FILE__))
48
- end
49
-
50
44
  def self.start(argv = ARGV)
51
45
  Vedeu::Launcher.execute!(argv)
52
46
  end
@@ -55,10 +49,5 @@ end # DSLApp
55
49
 
56
50
  DSLApp.start
57
51
 
58
- if DSLApp.expected == DSLApp.actual
59
- puts "#{__FILE__} \e[32mPassed.\e[39m"
60
- exit 0;
61
- else
62
- puts "#{__FILE__} \e[31mFailed.\e[39m"
63
- exit 1;
64
- end
52
+ load File.dirname(__FILE__) + '/test_runner.rb'
53
+ TestRunner.result(TESTCASE, __FILE__)
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'vedeu'
7
+
8
+ TESTCASE = 'dsl_app_border_006'
9
+
10
+ class DSLApp
11
+
12
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
13
+
14
+ Vedeu.configure do
15
+ debug!
16
+ height 10
17
+ log '/tmp/vedeu_views_dsl.log'
18
+ renderers [
19
+ Vedeu::Renderers::Terminal.new(
20
+ filename: "/tmp/#{TESTCASE}.out",
21
+ write_file: true),
22
+ # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
25
+ ]
26
+ run_once!
27
+ standalone!
28
+ end
29
+
30
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
31
+
32
+ Vedeu.border :test_interface do
33
+ foreground '#ff5722'
34
+ top_left 'A', colour: { background: '#ff0000' }
35
+ top_right 'B', colour: { background: '#0000ff', foreground: '#ffffff' }
36
+ bottom_left 'C', colour: { background: '#ffff00', foreground: '#000000' }
37
+ bottom_right 'D', colour: { background: '#ffffff' }
38
+ end
39
+
40
+ Vedeu.render do
41
+ view(:test_interface) do
42
+ lines do
43
+ line 'custom'
44
+ line 'vertices'
45
+ end
46
+ end
47
+ end
48
+
49
+ def self.start(argv = ARGV)
50
+ Vedeu::Launcher.execute!(argv)
51
+ end
52
+
53
+ end # DSLApp
54
+
55
+ DSLApp.start
56
+
57
+ load File.dirname(__FILE__) + '/test_runner.rb'
58
+ TestRunner.result(TESTCASE, __FILE__)
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'vedeu'
7
+
8
+ TESTCASE = 'dsl_app_border_007'
9
+
10
+ class DSLApp
11
+
12
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
13
+
14
+ Vedeu.configure do
15
+ debug!
16
+ height 10
17
+ log '/tmp/vedeu_views_dsl.log'
18
+ renderers [
19
+ Vedeu::Renderers::Terminal.new(
20
+ filename: "/tmp/#{TESTCASE}.out",
21
+ write_file: true),
22
+ # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
25
+ ]
26
+ run_once!
27
+ standalone!
28
+ end
29
+
30
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
31
+
32
+ Vedeu.border :test_interface do
33
+ foreground '#ff5722'
34
+ top_horizontal '*', colour: { background: '#000000', foreground: '#ffffff' }
35
+ left_vertical '$', colour: { background: '#0000ff', foreground: '#ffffff' }
36
+ right_vertical '%', colour: { background: '#ffff00', foreground: '#000000' }
37
+ bottom_horizontal '&', colour: { background: '#ffffff' }
38
+ end
39
+
40
+ Vedeu.render do
41
+ view(:test_interface) do
42
+ lines do
43
+ line 'custom'
44
+ line 'edges'
45
+ end
46
+ end
47
+ end
48
+
49
+ def self.start(argv = ARGV)
50
+ Vedeu::Launcher.execute!(argv)
51
+ end
52
+
53
+ end # DSLApp
54
+
55
+ DSLApp.start
56
+
57
+ load File.dirname(__FILE__) + '/test_runner.rb'
58
+ TestRunner.result(TESTCASE, __FILE__)
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'vedeu'
7
+
8
+ TESTCASE = 'dsl_app_border_008'
9
+
10
+ class DSLApp
11
+
12
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
13
+
14
+ Vedeu.configure do
15
+ debug!
16
+ height 10
17
+ log '/tmp/vedeu_views_dsl.log'
18
+ renderers [
19
+ Vedeu::Renderers::Terminal.new(
20
+ filename: "/tmp/#{TESTCASE}.out",
21
+ write_file: true),
22
+ # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
25
+ ]
26
+ run_once!
27
+ standalone!
28
+ end
29
+
30
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
31
+
32
+ Vedeu.border :test_interface do
33
+ foreground '#ffffff'
34
+ show_right false
35
+ show_bottom false
36
+ show_left false
37
+ end
38
+
39
+ Vedeu.render do
40
+ view(:test_interface) do
41
+ lines do
42
+ line 'only'
43
+ line 'top'
44
+ end
45
+ end
46
+ end
47
+
48
+ def self.start(argv = ARGV)
49
+ Vedeu::Launcher.execute!(argv)
50
+ end
51
+
52
+ end # DSLApp
53
+
54
+ DSLApp.start
55
+
56
+ load File.dirname(__FILE__) + '/test_runner.rb'
57
+ TestRunner.result(TESTCASE, __FILE__)
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'vedeu'
7
+
8
+ TESTCASE = 'dsl_app_border_009'
9
+
10
+ class DSLApp
11
+
12
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
13
+
14
+ Vedeu.configure do
15
+ debug!
16
+ height 10
17
+ log '/tmp/vedeu_views_dsl.log'
18
+ renderers [
19
+ Vedeu::Renderers::Terminal.new(
20
+ filename: "/tmp/#{TESTCASE}.out",
21
+ write_file: true),
22
+ # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
25
+ ]
26
+ run_once!
27
+ standalone!
28
+ end
29
+
30
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
31
+
32
+ Vedeu.border :test_interface do
33
+ foreground '#ffffff'
34
+ show_top false
35
+ show_bottom false
36
+ show_left false
37
+ end
38
+
39
+ Vedeu.render do
40
+ view(:test_interface) do
41
+ lines do
42
+ line 'only'
43
+ line 'right'
44
+ end
45
+ end
46
+ end
47
+
48
+ def self.start(argv = ARGV)
49
+ Vedeu::Launcher.execute!(argv)
50
+ end
51
+
52
+ end # DSLApp
53
+
54
+ DSLApp.start
55
+
56
+ load File.dirname(__FILE__) + '/test_runner.rb'
57
+ TestRunner.result(TESTCASE, __FILE__)
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'vedeu'
7
+
8
+ TESTCASE = 'dsl_app_border_010'
9
+
10
+ class DSLApp
11
+
12
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
13
+
14
+ Vedeu.configure do
15
+ debug!
16
+ height 10
17
+ log '/tmp/vedeu_views_dsl.log'
18
+ renderers [
19
+ Vedeu::Renderers::Terminal.new(
20
+ filename: "/tmp/#{TESTCASE}.out",
21
+ write_file: true),
22
+ # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
25
+ ]
26
+ run_once!
27
+ standalone!
28
+ end
29
+
30
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
31
+
32
+ Vedeu.border :test_interface do
33
+ foreground '#ffffff'
34
+ show_top false
35
+ show_right false
36
+ show_left false
37
+ end
38
+
39
+ Vedeu.render do
40
+ view(:test_interface) do
41
+ lines do
42
+ line 'only'
43
+ line 'bottom'
44
+ end
45
+ end
46
+ end
47
+
48
+ def self.start(argv = ARGV)
49
+ Vedeu::Launcher.execute!(argv)
50
+ end
51
+
52
+ end # DSLApp
53
+
54
+ DSLApp.start
55
+
56
+ load File.dirname(__FILE__) + '/test_runner.rb'
57
+ TestRunner.result(TESTCASE, __FILE__)
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require 'bundler/setup'
6
+ require 'vedeu'
7
+
8
+ TESTCASE = 'dsl_app_border_011'
9
+
10
+ class DSLApp
11
+
12
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
13
+
14
+ Vedeu.configure do
15
+ debug!
16
+ height 10
17
+ log '/tmp/vedeu_views_dsl.log'
18
+ renderers [
19
+ Vedeu::Renderers::Terminal.new(
20
+ filename: "/tmp/#{TESTCASE}.out",
21
+ write_file: true),
22
+ # Vedeu::Renderers::JSON.new(filename: "/tmp/#{TESTCASE}.json"),
23
+ # Vedeu::Renderers::HTML.new(filename: "/tmp/#{TESTCASE}.html"),
24
+ # Vedeu::Renderers::Text.new(filename: "/tmp/#{TESTCASE}.txt"),
25
+ ]
26
+ run_once!
27
+ standalone!
28
+ end
29
+
30
+ load File.dirname(__FILE__) + '/support/test_interface.rb'
31
+
32
+ Vedeu.border :test_interface do
33
+ foreground '#ffffff'
34
+ show_top false
35
+ show_right false
36
+ show_bottom false
37
+ end
38
+
39
+ Vedeu.render do
40
+ view(:test_interface) do
41
+ lines do
42
+ line 'only'
43
+ line 'left'
44
+ end
45
+ end
46
+ end
47
+
48
+ def self.start(argv = ARGV)
49
+ Vedeu::Launcher.execute!(argv)
50
+ end
51
+
52
+ end # DSLApp
53
+
54
+ DSLApp.start
55
+
56
+ load File.dirname(__FILE__) + '/test_runner.rb'
57
+ TestRunner.result(TESTCASE, __FILE__)
@@ -0,0 +1 @@
1
+ (0A(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(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0B(B(0x(Bcustom                       (0x(B(0x(Bvertices                     (0x(B(0x(B                             (0x(B(0C(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(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0D(B
@@ -0,0 +1 @@
1
+ (0l(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0*(B(0k(B(0$(Bcustom                       (0%(B(0$(Bedges                        (0%(B(0$(B                             (0%(B(0m(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0&(B(0j(B
@@ -0,0 +1 @@
1
+ (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(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(Bonly                           top                                                                                          
@@ -0,0 +1 @@
1
+ only                          (0x(Bright                         (0x(B                              (0x(B                              (0x(B                              (0x(B
@@ -0,0 +1 @@
1
+ only                           bottom                                                                                       (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(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B
@@ -0,0 +1 @@
1
+ (0x(Bonly                          (0x(Bleft                          (0x(B                              (0x(B                              (0x(B                              
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Provides the result of running an integration test.
4
+ #
5
+ # @api private
6
+ class TestRunner
7
+
8
+ # @param (see #initialize)
9
+ # @return [void]
10
+ def self.result(testcase, file)
11
+ new(testcase, file).result
12
+ end
13
+
14
+ # @param testcase [String]
15
+ # @param file [String]
16
+ # @return [TestRunner]
17
+ def initialize(testcase, file)
18
+ @testcase = testcase
19
+ @file = file
20
+ end
21
+
22
+ # @return [void]
23
+ def result
24
+ print "\e[36m#{file}: "
25
+ if expected == actual
26
+ print "\e[32mPassed.\e[39m\n"
27
+ exit 0;
28
+ else
29
+ print "\e[31mFailed.\e[39m\n"
30
+ puts "\e[33mExpected:\e[39m"
31
+ puts expected.inspect
32
+ puts "\e[34mActual:\e[39m"
33
+ puts actual.inspect
34
+ exit 1;
35
+ end
36
+ end
37
+
38
+ protected
39
+
40
+ # @!attribute [r] testcase
41
+ # @return [String]
42
+ attr_reader :testcase
43
+
44
+ # @!attribute [r] file
45
+ # @return [String]
46
+ attr_reader :file
47
+
48
+ private
49
+
50
+ # @return [String]
51
+ def actual
52
+ File.read("/tmp/#{testcase}.out")
53
+ end
54
+
55
+ # @return [String]
56
+ def expected
57
+ File.read(File.expand_path("../expected/#{testcase}.out", file))
58
+ end
59
+
60
+ end # TestRunner