vedeu 0.4.41 → 0.4.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -6
  3. data/bin/vedeu +1 -50
  4. data/docs/applications.md +18 -2
  5. data/lib/vedeu/all.rb +3 -1
  6. data/lib/vedeu/api.rb +3 -1
  7. data/lib/vedeu/application/controller.rb +5 -0
  8. data/lib/vedeu/buffers/buffer.rb +6 -3
  9. data/lib/vedeu/cli/all.rb +1 -0
  10. data/lib/vedeu/{generator → cli/generator}/all.rb +3 -3
  11. data/lib/vedeu/{generator → cli/generator}/application.rb +0 -0
  12. data/lib/vedeu/{generator → cli/generator}/helpers.rb +4 -11
  13. data/lib/vedeu/{generator → cli/generator}/templates/application/Gemfile +0 -0
  14. data/lib/vedeu/{generator → cli/generator}/templates/application/app/controllers/application_controller.erb +0 -0
  15. data/lib/vedeu/{generator → cli/generator}/templates/application/app/controllers/name.erb +2 -0
  16. data/lib/vedeu/{generator → cli/generator}/templates/application/app/helpers/application_helper.erb +0 -0
  17. data/lib/vedeu/{generator → cli/generator}/templates/application/app/helpers/name.erb +0 -0
  18. data/lib/vedeu/{generator → cli/generator}/templates/application/app/models/keymaps/_global_.rb +0 -0
  19. data/lib/vedeu/{generator → cli/generator}/templates/application/app/models/keymaps/name.erb +0 -0
  20. data/lib/vedeu/{generator → cli/generator}/templates/application/app/views/interfaces/name.erb +6 -0
  21. data/lib/vedeu/{generator → cli/generator}/templates/application/app/views/name.erb +0 -0
  22. data/lib/vedeu/{generator → cli/generator}/templates/application/app/views/templates/name.erb +0 -0
  23. data/lib/vedeu/{generator → cli/generator}/templates/application/application.erb +0 -0
  24. data/lib/vedeu/{generator → cli/generator}/templates/application/bin/name +0 -0
  25. data/lib/vedeu/{generator → cli/generator}/templates/application/config/app_name.erb +0 -0
  26. data/lib/vedeu/{generator → cli/generator}/templates/application/config/configuration.erb +0 -0
  27. data/lib/vedeu/{generator → cli/generator}/templates/application/lib/.gitkeep +0 -0
  28. data/lib/vedeu/{generator → cli/generator}/templates/application/test/.gitkeep +0 -0
  29. data/lib/vedeu/{generator → cli/generator}/templates/application/vendor/.gitkeep +0 -0
  30. data/lib/vedeu/{generator → cli/generator}/view.rb +1 -2
  31. data/lib/vedeu/cli/main.rb +29 -0
  32. data/lib/vedeu/dsl/presentation.rb +6 -2
  33. data/lib/vedeu/dsl/view.rb +2 -1
  34. data/lib/vedeu/geometry/area.rb +4 -4
  35. data/lib/vedeu/models/interface.rb +0 -3
  36. data/lib/vedeu/output/colour.rb +16 -35
  37. data/lib/vedeu/output/presentation.rb +34 -21
  38. data/lib/vedeu/output/translator.rb +2 -5
  39. data/lib/vedeu/repositories/model.rb +4 -13
  40. data/lib/vedeu/support/common.rb +30 -0
  41. data/lib/vedeu/version.rb +1 -1
  42. data/lib/vedeu.rb +2 -0
  43. data/test/lib/vedeu/application/application_view_test.rb +2 -4
  44. data/test/lib/vedeu/application/controller_test.rb +26 -0
  45. data/test/lib/vedeu/application/helper_test.rb +26 -0
  46. data/test/lib/vedeu/application/view_test.rb +26 -0
  47. data/test/lib/vedeu/application_test.rb +2 -4
  48. data/test/lib/vedeu/bootstrap_test.rb +3 -5
  49. data/test/lib/vedeu/{generator → cli/generator}/application_test.rb +0 -0
  50. data/test/lib/vedeu/{generator → cli/generator}/helpers_test.rb +1 -9
  51. data/test/lib/vedeu/{generator → cli/generator}/view_test.rb +0 -0
  52. data/test/lib/vedeu/cli/main_test.rb +12 -0
  53. data/test/lib/vedeu/cursor/reposition_test.rb +0 -2
  54. data/test/lib/vedeu/distributed/subprocess_test.rb +3 -5
  55. data/test/lib/vedeu/distributed/uri_test.rb +3 -5
  56. data/test/lib/vedeu/dsl/border_test.rb +0 -17
  57. data/test/lib/vedeu/dsl/composition_test.rb +0 -8
  58. data/test/lib/vedeu/dsl/presentation_test.rb +34 -22
  59. data/test/lib/vedeu/dsl/view_test.rb +1 -0
  60. data/test/lib/vedeu/events/trigger_test.rb +4 -6
  61. data/test/lib/vedeu/geometry/geometry_test.rb +15 -14
  62. data/test/lib/vedeu/models/composition_test.rb +2 -4
  63. data/test/lib/vedeu/models/focus_test.rb +5 -2
  64. data/test/lib/vedeu/models/group_test.rb +5 -7
  65. data/test/lib/vedeu/models/interface_test.rb +12 -16
  66. data/test/lib/vedeu/models/menu_test.rb +8 -8
  67. data/test/lib/vedeu/output/border_test.rb +20 -21
  68. data/test/lib/vedeu/output/colour_test.rb +41 -122
  69. data/test/lib/vedeu/output/presentation_test.rb +30 -27
  70. data/test/lib/vedeu/output/translator_test.rb +12 -1
  71. data/test/lib/vedeu/support/common_test.rb +17 -2
  72. data/test/test_helper.rb +3 -1
  73. data/vedeu.gemspec +2 -1
  74. metadata +53 -31
  75. data/lib/vedeu/tasks/application.rake +0 -28
  76. data/lib/vedeu/tasks/vedeu.rake +0 -5
@@ -34,10 +34,7 @@ module Vedeu
34
34
  # @param value [Object|NilClass]
35
35
  # @return [Object]
36
36
  def self.coerce(value)
37
- if value.nil?
38
- ''
39
-
40
- elsif value.is_a?(self)
37
+ if value.is_a?(self)
41
38
  value
42
39
 
43
40
  else
@@ -51,7 +48,7 @@ module Vedeu
51
48
  # @param colour [Fixnum|String|Symbol]
52
49
  # @return [Translator]
53
50
  def initialize(colour = '')
54
- @colour = colour
51
+ @colour = colour || ''
55
52
  end
56
53
 
57
54
  # An object is equal when its values are the same.
@@ -1,3 +1,5 @@
1
+ require 'vedeu/support/common'
2
+
1
3
  module Vedeu
2
4
 
3
5
  # When included into a class, provides the mechanism to store the class in a
@@ -6,6 +8,8 @@ module Vedeu
6
8
  # @api private
7
9
  module Model
8
10
 
11
+ include Vedeu::Common
12
+
9
13
  # @!attribute [rw] repository
10
14
  # @return [Vedeu::Repository]
11
15
  attr_accessor :repository
@@ -95,19 +99,6 @@ module Vedeu
95
99
 
96
100
  private
97
101
 
98
- # Removes the module part from the expression in the string.
99
- #
100
- # @example
101
- # demodulize('Vedeu::DSL::Interface') # => "Interface"
102
- #
103
- # @param klass [Class|String]
104
- # @return [void]
105
- def demodulize(klass)
106
- klass = klass.to_s
107
-
108
- klass[(klass.rindex('::') + 2)..-1]
109
- end
110
-
111
102
  # Returns the DSL class name responsible for this model.
112
103
  #
113
104
  # @return [String]
@@ -5,6 +5,36 @@ module Vedeu
5
5
  # @api private
6
6
  module Common
7
7
 
8
+ # Removes the module part from the expression in the string.
9
+ #
10
+ # @example
11
+ # demodulize('Vedeu::DSL::Interface') # => "Interface"
12
+ #
13
+ # @param klass [Class|String]
14
+ # @return [void]
15
+ def demodulize(klass)
16
+ klass = klass.to_s
17
+
18
+ klass[(klass.rindex('::') + 2)..-1]
19
+ end
20
+
21
+ # Converts a class name to a lowercase snake case string.
22
+ #
23
+ # @example
24
+ # snake_case(MyClassName) # => "my_class_name"
25
+ # snake_case(NameSpaced::ClassName) # => "name_spaced/class_name"
26
+ #
27
+ # @param name [String]
28
+ # @return [String]
29
+ def snake_case(name)
30
+ name.gsub!(/::/, '/')
31
+ name.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
32
+ name.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
33
+ name.tr!('-', '_')
34
+ name.downcase!
35
+ name
36
+ end
37
+
8
38
  # Returns a boolean indicating whether a variable has a useful value.
9
39
  #
10
40
  # @param variable [String|Symbol|Array|Fixnum] The variable to check.
data/lib/vedeu/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Vedeu
2
2
 
3
3
  # The current version of Vedeu.
4
- VERSION = '0.4.41'
4
+ VERSION = '0.4.42'
5
5
 
6
6
  end
data/lib/vedeu.rb CHANGED
@@ -15,6 +15,8 @@ require 'singleton'
15
15
  require 'thread'
16
16
  require 'time'
17
17
 
18
+ require 'thor'
19
+
18
20
  require 'vedeu/support/log'
19
21
 
20
22
  # Vedeu is a GUI framework for terminal/console applications written in Ruby.
@@ -9,10 +9,8 @@ module Vedeu
9
9
  let(:object) {}
10
10
 
11
11
  describe '#initialize' do
12
- subject { instance }
13
-
14
- it { subject.must_be_instance_of(Vedeu::ApplicationView) }
15
- it { subject.instance_variable_get('@object').must_equal(object) }
12
+ it { instance.must_be_instance_of(Vedeu::ApplicationView) }
13
+ it { instance.instance_variable_get('@object').must_equal(object) }
16
14
  end
17
15
 
18
16
  describe '.render' do
@@ -0,0 +1,26 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ class ControllerTestClass
6
+
7
+ include Vedeu::Controller
8
+
9
+ end # ControllerTestClass
10
+
11
+ describe Controller do
12
+
13
+ let(:described) { Vedeu::ControllerTestClass }
14
+ let(:instance) { described.new }
15
+
16
+ context 'ClassMethods' do
17
+
18
+ end
19
+
20
+ context 'InstanceMethods' do
21
+
22
+ end
23
+
24
+ end # Controller
25
+
26
+ end # Vedeu
@@ -0,0 +1,26 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ class HelperTestClass
6
+
7
+ include Vedeu::Helper
8
+
9
+ end # HelperTestClass
10
+
11
+ describe Helper do
12
+
13
+ let(:described) { Vedeu::HelperTestClass }
14
+ let(:instance) { described.new }
15
+
16
+ context 'ClassMethods' do
17
+
18
+ end
19
+
20
+ context 'InstanceMethods' do
21
+
22
+ end
23
+
24
+ end # Helper
25
+
26
+ end # Vedeu
@@ -0,0 +1,26 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ class ViewTestClass
6
+
7
+ include Vedeu::View
8
+
9
+ end # ViewTestClass
10
+
11
+ describe View do
12
+
13
+ let(:described) { Vedeu::ViewTestClass }
14
+ let(:instance) { described.new }
15
+
16
+ context 'ClassMethods' do
17
+
18
+ end
19
+
20
+ context 'InstanceMethods' do
21
+
22
+ end
23
+
24
+ end # View
25
+
26
+ end # Vedeu
@@ -14,11 +14,9 @@ module Vedeu
14
14
  end
15
15
 
16
16
  describe '#initialize' do
17
- subject { instance }
18
-
19
- it { subject.must_be_instance_of(described) }
17
+ it { instance.must_be_instance_of(described) }
20
18
  it do
21
- subject.instance_variable_get('@configuration').
19
+ instance.instance_variable_get('@configuration').
22
20
  must_equal(configuration)
23
21
  end
24
22
  end
@@ -10,12 +10,10 @@ module Vedeu
10
10
  let(:entry_point) {}
11
11
 
12
12
  describe '#initialize' do
13
- subject { instance }
14
-
15
- it { subject.must_be_instance_of(described) }
16
- it { subject.instance_variable_get('@argv').must_equal(argv) }
13
+ it { instance.must_be_instance_of(described) }
14
+ it { instance.instance_variable_get('@argv').must_equal(argv) }
17
15
  it do
18
- subject.instance_variable_get('@entry_point').must_equal(entry_point)
16
+ instance.instance_variable_get('@entry_point').must_equal(entry_point)
19
17
  end
20
18
  end
21
19
 
@@ -26,14 +26,6 @@ module Vedeu
26
26
  # it { subject.must_equal('MyFirstApp') }
27
27
  end
28
28
 
29
- describe '#app_name_as_snake_case' do
30
- let(:_name) { 'MyFirstApp' }
31
-
32
- subject { instance.app_name_as_snake_case(_name) }
33
-
34
- it { subject.must_equal('my_first_app') }
35
- end
36
-
37
29
  describe '#make_directory' do
38
30
  let(:destination) {}
39
31
 
@@ -119,7 +111,7 @@ module Vedeu
119
111
 
120
112
  it { subject.must_be_instance_of(String) }
121
113
 
122
- it { subject.must_match('vedeu/generator/templates/application/.') }
114
+ it { subject.must_match('vedeu/cli/generator/templates/application/.') }
123
115
  end
124
116
 
125
117
  end # Helpers
@@ -0,0 +1,12 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ module CLI
6
+
7
+ describe Main do
8
+ end # Main
9
+
10
+ end # CLI
11
+
12
+ end # Vedeu
@@ -19,8 +19,6 @@ module Vedeu
19
19
  after { Vedeu.cursors.reset }
20
20
 
21
21
  describe '#initialize' do
22
- subject { instance }
23
-
24
22
  it { instance.must_be_instance_of(Vedeu::Reposition) }
25
23
  it { instance.instance_variable_get('@entity').must_equal(entity) }
26
24
  it { instance.instance_variable_get('@name').must_equal(_name) }
@@ -9,13 +9,11 @@ module Vedeu
9
9
  let(:application) {}
10
10
 
11
11
  describe '#initialize' do
12
- subject { instance }
13
-
14
- it { subject.must_be_instance_of(described) }
12
+ it { instance.must_be_instance_of(described) }
15
13
  it do
16
- subject.instance_variable_get('@application').must_equal(application)
14
+ instance.instance_variable_get('@application').must_equal(application)
17
15
  end
18
- it { subject.instance_variable_get('@pid').must_equal(nil) }
16
+ it { instance.instance_variable_get('@pid').must_equal(nil) }
19
17
  end
20
18
 
21
19
  describe '.execute!' do
@@ -12,11 +12,9 @@ module Vedeu
12
12
  let(:port) {}
13
13
 
14
14
  describe '#initialize' do
15
- subject { instance }
16
-
17
- it { subject.must_be_instance_of(described) }
18
- it { subject.instance_variable_get('@host').must_equal('localhost') }
19
- it { subject.instance_variable_get('@port').must_equal(21_420) }
15
+ it { instance.must_be_instance_of(described) }
16
+ it { instance.instance_variable_get('@host').must_equal('localhost') }
17
+ it { instance.instance_variable_get('@port').must_equal(21_420) }
20
18
  end
21
19
 
22
20
  describe '#host' do
@@ -13,23 +13,6 @@ module Vedeu
13
13
  let(:attributes) { { name: 'borders' } }
14
14
  let(:boolean) { true }
15
15
 
16
- before do
17
- Vedeu.interface 'borders' do
18
- geometry do
19
- height 3
20
- width 3
21
- end
22
- lines do
23
- line ''
24
- end
25
- end
26
- end
27
- after do
28
- Vedeu.borders.reset
29
- Vedeu.buffers.reset
30
- Vedeu.interfaces.reset
31
- end
32
-
33
16
  describe '#initialize' do
34
17
  it { instance.must_be_instance_of(described) }
35
18
  it { instance.instance_variable_get('@model').must_equal(model) }
@@ -37,14 +37,6 @@ module Vedeu
37
37
  let(:filename) {}
38
38
  let(:object) {}
39
39
  let(:content) { "Hydrogen\nCarbon\nOxygen\nNitrogen" }
40
- let(:as_lines) {
41
- [
42
- Vedeu::Line.new(streams: [Vedeu::Stream.new(value: 'Hydrogen')]),
43
- Vedeu::Line.new(streams: [Vedeu::Stream.new(value: 'Carbon')]),
44
- Vedeu::Line.new(streams: [Vedeu::Stream.new(value: 'Oxygen')]),
45
- Vedeu::Line.new(streams: [Vedeu::Stream.new(value: 'Nitrogen')])
46
- ]
47
- }
48
40
 
49
41
  subject { instance.template_for(_name, filename, object) }
50
42
 
@@ -12,34 +12,49 @@ module Vedeu
12
12
  let(:background) { '#00ff00' }
13
13
  let(:foreground) { '#ff00ff' }
14
14
 
15
+ context 'setting both background and foreground' do
16
+ let(:dsl) {
17
+ Vedeu.interface 'my_interface' do
18
+ background '#00ff00'
19
+ foreground '#ff00ff'
20
+ end
21
+ }
22
+ after { Vedeu.interfaces.reset }
23
+
24
+ it { dsl.colour.background.colour.must_equal(background) }
25
+ it { dsl.colour.foreground.colour.must_equal(foreground) }
26
+ end
27
+
15
28
  describe '#background' do
29
+ let(:dsl) {
30
+ Vedeu.interface 'my_interface' do
31
+ background '#00ff00'
32
+ end
33
+ }
34
+ after { Vedeu.interfaces.reset }
35
+
16
36
  subject { instance.background(background) }
17
37
 
18
38
  it { instance.must_respond_to(:bg) }
19
39
  it { instance.must_respond_to(:bgcolor) }
20
-
21
- it { subject.must_be_instance_of(Vedeu::Colour) }
22
-
23
- it 'sets the background' do
24
- subject.attributes.must_equal(
25
- background: '#00ff00', foreground: ''
26
- )
27
- end
40
+ it { dsl.colour.background.must_be_instance_of(Vedeu::Background) }
41
+ it { dsl.colour.background.colour.must_equal(background) }
28
42
  end
29
43
 
30
44
  describe '#foreground' do
45
+ let(:dsl) {
46
+ Vedeu.interface 'my_interface' do
47
+ foreground '#ff00ff'
48
+ end
49
+ }
50
+ after { Vedeu.interfaces.reset }
51
+
31
52
  subject { instance.foreground(foreground) }
32
53
 
33
54
  it { instance.must_respond_to(:fg) }
34
55
  it { instance.must_respond_to(:fgcolor) }
35
-
36
- it { subject.must_be_instance_of(Vedeu::Colour) }
37
-
38
- it 'sets the foreground' do
39
- subject.attributes.must_equal(
40
- background: '', foreground: '#ff00ff'
41
- )
42
- end
56
+ it { dsl.colour.foreground.must_be_instance_of(Vedeu::Foreground) }
57
+ it { dsl.colour.foreground.colour.must_equal(foreground) }
43
58
  end
44
59
 
45
60
  describe '#colour' do
@@ -52,16 +67,13 @@ module Vedeu
52
67
  context 'with an empty value' do
53
68
  let(:attributes) { { background: background, foreground: '' } }
54
69
 
55
- it 'sets only the valid attributes' do
56
- subject.attributes.must_equal(
57
- background: '#00ff00', foreground: ''
58
- )
59
- end
70
+ it { subject.background.colour.must_equal(background) }
71
+ it { subject.foreground.colour.must_equal('') }
60
72
  end
61
73
  end
62
74
 
63
75
  describe '#style' do
64
- let(:args) { :bold }
76
+ let(:args) { :bold }
65
77
 
66
78
  subject { instance.style(args) }
67
79
 
@@ -43,6 +43,7 @@ module Vedeu
43
43
  end
44
44
  }
45
45
 
46
+ it { described.must_respond_to(:render) }
46
47
  it { subject.must_be_instance_of(Array) }
47
48
 
48
49
  context 'when the block is not given' do
@@ -18,13 +18,11 @@ module Vedeu
18
18
  end
19
19
 
20
20
  describe '#initialize' do
21
- subject { instance }
22
-
23
- it { subject.must_be_instance_of(described) }
24
- it { subject.instance_variable_get('@name').must_equal(event_name) }
25
- it { subject.instance_variable_get('@args').must_equal([args]) }
21
+ it { instance.must_be_instance_of(described) }
22
+ it { instance.instance_variable_get('@name').must_equal(event_name) }
23
+ it { instance.instance_variable_get('@args').must_equal([args]) }
26
24
  it do
27
- subject.instance_variable_get('@repository').must_equal(Vedeu.events)
25
+ instance.instance_variable_get('@repository').must_equal(Vedeu.events)
28
26
  end
29
27
  end
30
28
 
@@ -33,21 +33,22 @@ module Vedeu
33
33
  before { Terminal.stubs(:size).returns([12, 40]) }
34
34
 
35
35
  describe '#initialize' do
36
- subject { instance }
37
-
38
- it { subject.must_be_instance_of(described) }
39
- it { subject.instance_variable_get('@attributes').must_equal(attributes) }
40
- it { subject.instance_variable_get('@centred').must_equal(centred) }
41
- it { subject.instance_variable_get('@height').must_equal(height) }
42
- it { subject.instance_variable_get('@maximised').must_equal(maximised) }
43
- it { subject.instance_variable_get('@name').must_equal(_name) }
44
- it { subject.instance_variable_get('@width').must_equal(width) }
45
- it { subject.instance_variable_get('@x').must_equal(x) }
46
- it { subject.instance_variable_get('@xn').must_equal(xn) }
47
- it { subject.instance_variable_get('@y').must_equal(y) }
48
- it { subject.instance_variable_get('@yn').must_equal(yn) }
36
+ it { instance.must_be_instance_of(described) }
37
+ it {
38
+ instance.instance_variable_get('@attributes').must_equal(attributes)
39
+ }
40
+ it { instance.instance_variable_get('@centred').must_equal(centred) }
41
+ it { instance.instance_variable_get('@height').must_equal(height) }
42
+ it { instance.instance_variable_get('@maximised').must_equal(maximised) }
43
+ it { instance.instance_variable_get('@name').must_equal(_name) }
44
+ it { instance.instance_variable_get('@width').must_equal(width) }
45
+ it { instance.instance_variable_get('@x').must_equal(x) }
46
+ it { instance.instance_variable_get('@xn').must_equal(xn) }
47
+ it { instance.instance_variable_get('@y').must_equal(y) }
48
+ it { instance.instance_variable_get('@yn').must_equal(yn) }
49
49
  it do
50
- subject.instance_variable_get('@repository').must_equal(Vedeu.geometries)
50
+ instance.instance_variable_get('@repository').
51
+ must_equal(Vedeu.geometries)
51
52
  end
52
53
  end
53
54
 
@@ -28,10 +28,8 @@ module Vedeu
28
28
  end
29
29
 
30
30
  describe '#initialize' do
31
- subject { instance }
32
-
33
- it { subject.must_be_instance_of(described) }
34
- it { subject.instance_variable_get('@interfaces').must_equal(interfaces) }
31
+ it { instance.must_be_instance_of(described) }
32
+ it { instance.instance_variable_get('@interfaces').must_equal(interfaces) }
35
33
  end
36
34
 
37
35
  describe '#add' do
@@ -98,6 +98,8 @@ module Vedeu
98
98
  end
99
99
 
100
100
  describe '#current' do
101
+ before { Focus.reset }
102
+
101
103
  subject { described.current }
102
104
 
103
105
  it 'returns the name of the interface currently in focus' do
@@ -108,8 +110,6 @@ module Vedeu
108
110
  end
109
111
 
110
112
  context 'when no interfaces are defined' do
111
- before { Focus.reset }
112
-
113
113
  it { subject.must_equal(nil) }
114
114
  end
115
115
 
@@ -162,6 +162,7 @@ module Vedeu
162
162
 
163
163
  describe '#next_visible_item' do
164
164
  before do
165
+ Vedeu.stubs(:trigger)
165
166
  Vedeu.interface('gold') { visible true }
166
167
  Vedeu.interface('silver') { visible true }
167
168
  Vedeu.interface('platinum') { visible false }
@@ -192,6 +193,7 @@ module Vedeu
192
193
 
193
194
  describe '#prev_item' do
194
195
  it 'the previous interface is focussed when the method is called' do
196
+
195
197
  Focus.add('thallium')
196
198
  Focus.add('lead')
197
199
  Focus.add('bismuth')
@@ -207,6 +209,7 @@ module Vedeu
207
209
 
208
210
  describe '#prev_visible_item' do
209
211
  before do
212
+ Vedeu.stubs(:trigger)
210
213
  Vedeu.interface('gold') { visible true }
211
214
  Vedeu.interface('silver') { visible true }
212
215
  Vedeu.interface('platinum') { visible false }
@@ -16,16 +16,14 @@ module Vedeu
16
16
  let(:members) { ['carbon', 'nitrogen', 'oxygen'] }
17
17
 
18
18
  describe '#initialize' do
19
- subject { instance }
20
-
21
- it { subject.must_be_instance_of(described) }
19
+ it { instance.must_be_instance_of(described) }
22
20
  it {
23
- subject.instance_variable_get('@attributes').must_be_instance_of(Hash)
21
+ instance.instance_variable_get('@attributes').must_be_instance_of(Hash)
24
22
  }
25
- it { subject.instance_variable_get('@members').must_equal(members) }
26
- it { subject.instance_variable_get('@name').must_equal(_name) }
23
+ it { instance.instance_variable_get('@members').must_equal(members) }
24
+ it { instance.instance_variable_get('@name').must_equal(_name) }
27
25
  it {
28
- subject.instance_variable_get('@repository').must_equal(Vedeu.groups)
26
+ instance.instance_variable_get('@repository').must_equal(Vedeu.groups)
29
27
  }
30
28
  end
31
29
 
@@ -33,18 +33,18 @@ module Vedeu
33
33
  let(:zindex) { 1 }
34
34
 
35
35
  describe '#initialize' do
36
- subject { instance }
37
-
38
- it { subject.must_be_instance_of(described) }
39
- it { subject.instance_variable_get('@client').must_equal(client) }
40
- it { subject.instance_variable_get('@delay').must_equal(delay) }
41
- it { subject.instance_variable_get('@group').must_equal(group) }
42
- it { subject.instance_variable_get('@lines').must_equal(lines) }
43
- it { subject.instance_variable_get('@name').must_equal(_name) }
44
- it { subject.instance_variable_get('@parent').must_equal(parent) }
45
- it { subject.instance_variable_get('@repository').must_equal(repository) }
46
- it { subject.instance_variable_get('@visible').must_equal(visible) }
47
- it { subject.instance_variable_get('@zindex').must_equal(zindex) }
36
+ it { instance.must_be_instance_of(described) }
37
+ it { instance.instance_variable_get('@client').must_equal(client) }
38
+ it { instance.instance_variable_get('@delay').must_equal(delay) }
39
+ it { instance.instance_variable_get('@group').must_equal(group) }
40
+ it { instance.instance_variable_get('@lines').must_equal(lines) }
41
+ it { instance.instance_variable_get('@name').must_equal(_name) }
42
+ it { instance.instance_variable_get('@parent').must_equal(parent) }
43
+ it {
44
+ instance.instance_variable_get('@repository').must_equal(repository)
45
+ }
46
+ it { instance.instance_variable_get('@visible').must_equal(visible) }
47
+ it { instance.instance_variable_get('@zindex').must_equal(zindex) }
48
48
  end
49
49
 
50
50
  describe 'accessors' do
@@ -70,16 +70,12 @@ module Vedeu
70
70
  describe '#lines' do
71
71
  subject { instance.lines }
72
72
 
73
- it { instance.must_respond_to(:content) }
74
73
  it { instance.must_respond_to(:value) }
75
74
  end
76
75
 
77
76
  describe '#lines?' do
78
77
  subject { instance.lines? }
79
78
 
80
- it { instance.must_respond_to(:content?) }
81
- it { instance.must_respond_to(:value?) }
82
-
83
79
  context 'when the interface has content' do
84
80
  let(:lines) { [:line] }
85
81