vedeu 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/.travis.yml +1 -1
- data/README.md +2 -6
- data/config/rubocop_enabled.yml +0 -6
- data/docs/dsl/by_method/clock_time.md +4 -1
- data/lib/vedeu/application/application_controller.rb +2 -2
- data/lib/vedeu/application/controller.rb +3 -3
- data/lib/vedeu/borders/border.rb +6 -6
- data/lib/vedeu/borders/dsl.rb +26 -26
- data/lib/vedeu/borders/refresh.rb +2 -2
- data/lib/vedeu/borders/title.rb +4 -4
- data/lib/vedeu/buffers/refresh.rb +8 -7
- data/lib/vedeu/buffers/terminal.rb +1 -1
- data/lib/vedeu/buffers/view.rb +2 -2
- data/lib/vedeu/cells/clear.rb +1 -1
- data/lib/vedeu/cells/cursor.rb +6 -6
- data/lib/vedeu/cells/empty.rb +2 -2
- data/lib/vedeu/cells/escape.rb +6 -6
- data/lib/vedeu/coercers/alignment.rb +1 -1
- data/lib/vedeu/coercers/colour_attributes.rb +8 -16
- data/lib/vedeu/colours/background.rb +4 -8
- data/lib/vedeu/colours/colour.rb +4 -4
- data/lib/vedeu/colours/foreground.rb +4 -8
- data/lib/vedeu/colours/repository.rb +1 -1
- data/lib/vedeu/colours/translator.rb +6 -6
- data/lib/vedeu/common.rb +1 -1
- data/lib/vedeu/configuration/api.rb +15 -15
- data/lib/vedeu/configuration/configuration.rb +8 -8
- data/lib/vedeu/cursors/coordinate.rb +4 -4
- data/lib/vedeu/cursors/cursor.rb +2 -2
- data/lib/vedeu/distributed/client.rb +2 -2
- data/lib/vedeu/distributed/server.rb +8 -10
- data/lib/vedeu/distributed/subprocess.rb +1 -1
- data/lib/vedeu/distributed/uri.rb +1 -1
- data/lib/vedeu/dsl/cursors.rb +2 -2
- data/lib/vedeu/dsl/elements.rb +5 -5
- data/lib/vedeu/dsl/helpers/align.rb +1 -1
- data/lib/vedeu/dsl/helpers/attributes.rb +1 -1
- data/lib/vedeu/dsl/presentation.rb +15 -15
- data/lib/vedeu/dsl/view.rb +1 -1
- data/lib/vedeu/dsl/views.rb +1 -1
- data/lib/vedeu/editor/cursor.rb +1 -1
- data/lib/vedeu/editor/line.rb +2 -2
- data/lib/vedeu/editor/lines.rb +2 -2
- data/lib/vedeu/esc/borders.rb +19 -19
- data/lib/vedeu/esc/colours.rb +1 -1
- data/lib/vedeu/events/aliases.rb +3 -15
- data/lib/vedeu/events/event.rb +14 -14
- data/lib/vedeu/events/repository.rb +1 -1
- data/lib/vedeu/geometries/area/area.rb +5 -5
- data/lib/vedeu/geometries/area/dimension.rb +1 -1
- data/lib/vedeu/geometries/dsl/dsl.rb +7 -7
- data/lib/vedeu/geometries/geometry.rb +2 -2
- data/lib/vedeu/geometries/position.rb +6 -6
- data/lib/vedeu/groups/clear.rb +2 -2
- data/lib/vedeu/groups/group.rb +2 -2
- data/lib/vedeu/input/dsl.rb +1 -1
- data/lib/vedeu/input/key.rb +3 -3
- data/lib/vedeu/input/mapper.rb +2 -2
- data/lib/vedeu/input/read.rb +2 -4
- data/lib/vedeu/input/store.rb +1 -17
- data/lib/vedeu/input/translator.rb +49 -45
- data/lib/vedeu/interfaces/clear.rb +3 -3
- data/lib/vedeu/interfaces/dsl.rb +4 -4
- data/lib/vedeu/interfaces/interface.rb +2 -2
- data/lib/vedeu/logging/clock_time.rb +3 -3
- data/lib/vedeu/logging/debug.rb +14 -6
- data/lib/vedeu/logging/log.rb +1 -1
- data/lib/vedeu/menus/dsl.rb +2 -2
- data/lib/vedeu/menus/menu.rb +9 -9
- data/lib/vedeu/models/focus.rb +11 -11
- data/lib/vedeu/models/page.rb +1 -1
- data/lib/vedeu/models/row.rb +1 -1
- data/lib/vedeu/models/toggleable.rb +7 -7
- data/lib/vedeu/null/generic.rb +29 -29
- data/lib/vedeu/output/compressor_cache.rb +1 -11
- data/lib/vedeu/output/viewport.rb +4 -12
- data/lib/vedeu/output/write.rb +3 -3
- data/lib/vedeu/plugins/plugin.rb +1 -1
- data/lib/vedeu/presentation/colour.rb +1 -1
- data/lib/vedeu/presentation/presentation.rb +1 -1
- data/lib/vedeu/presentation/style.rb +4 -4
- data/lib/vedeu/renderers/all.rb +1 -14
- data/lib/vedeu/renderers/options.rb +1 -1
- data/lib/vedeu/repositories/all.rb +1 -0
- data/lib/vedeu/repositories/assemblage.rb +1 -1
- data/lib/vedeu/repositories/collection.rb +4 -4
- data/lib/vedeu/repositories/registerable.rb +2 -2
- data/lib/vedeu/repositories/repositories.rb +1 -1
- data/lib/vedeu/repositories/repository.rb +3 -3
- data/lib/vedeu/repositories/storage.rb +38 -0
- data/lib/vedeu/repositories/store.rb +5 -22
- data/lib/vedeu/runtime/application.rb +1 -1
- data/lib/vedeu/runtime/flags.rb +3 -3
- data/lib/vedeu/runtime/router.rb +3 -18
- data/lib/vedeu/templating/helpers.rb +5 -3
- data/lib/vedeu/templating/view_template.rb +26 -18
- data/lib/vedeu/terminal/terminal.rb +5 -5
- data/lib/vedeu/version.rb +1 -1
- data/lib/vedeu/views/chars.rb +1 -1
- data/lib/vedeu/views/composition.rb +4 -4
- data/lib/vedeu/views/default_attributes.rb +2 -2
- data/lib/vedeu/views/line.rb +6 -6
- data/lib/vedeu/views/lines.rb +1 -1
- data/lib/vedeu/views/stream.rb +6 -6
- data/lib/vedeu/views/streams.rb +1 -1
- data/lib/vedeu/views/view.rb +4 -4
- data/test/lib/vedeu/borders/border_test.rb +1 -1
- data/test/lib/vedeu/borders/caption_test.rb +1 -1
- data/test/lib/vedeu/borders/dsl_test.rb +2 -3
- data/test/lib/vedeu/borders/refresh_test.rb +1 -1
- data/test/lib/vedeu/borders/title_test.rb +1 -1
- data/test/lib/vedeu/buffers/buffer_test.rb +7 -7
- data/test/lib/vedeu/buffers/refresh_test.rb +1 -1
- data/test/lib/vedeu/colours/background_test.rb +27 -0
- data/test/lib/vedeu/colours/foreground_test.rb +27 -0
- data/test/lib/vedeu/cursors/cursor_test.rb +3 -3
- data/test/lib/vedeu/cursors/move_test.rb +1 -1
- data/test/lib/vedeu/cursors/refresh_test.rb +1 -1
- data/test/lib/vedeu/cursors/reposition_test.rb +2 -2
- data/test/lib/vedeu/dsl/view_test.rb +6 -8
- data/test/lib/vedeu/editor/cropper_test.rb +1 -1
- data/test/lib/vedeu/editor/cursor_test.rb +1 -1
- data/test/lib/vedeu/editor/document_test.rb +1 -1
- data/test/lib/vedeu/editor/editor_test.rb +1 -1
- data/test/lib/vedeu/events/aliases_test.rb +0 -14
- data/test/lib/vedeu/geometries/area/area_test.rb +1 -1
- data/test/lib/vedeu/geometries/geometry_test.rb +1 -1
- data/test/lib/vedeu/geometries/move_test.rb +1 -1
- data/test/lib/vedeu/groups/clear_test.rb +1 -1
- data/test/lib/vedeu/groups/dsl_test.rb +1 -1
- data/test/lib/vedeu/groups/group_test.rb +1 -1
- data/test/lib/vedeu/groups/refresh_test.rb +1 -1
- data/test/lib/vedeu/input/capture_test.rb +2 -2
- data/test/lib/vedeu/input/store_test.rb +0 -34
- data/test/lib/vedeu/interfaces/clear_test.rb +1 -1
- data/test/lib/vedeu/interfaces/dsl_test.rb +4 -4
- data/test/lib/vedeu/interfaces/interface_test.rb +1 -1
- data/test/lib/vedeu/menus/dsl_test.rb +1 -1
- data/test/lib/vedeu/null/generic_test.rb +1 -1
- data/test/lib/vedeu/output/compressor_cache_test.rb +0 -33
- data/test/lib/vedeu/renderers/all_test.rb +0 -8
- data/test/lib/vedeu/repositories/repository_test.rb +2 -2
- data/test/lib/vedeu/repositories/storage_test.rb +74 -0
- data/test/lib/vedeu/repositories/store_test.rb +10 -28
- data/test/lib/vedeu/runtime/router_test.rb +0 -8
- data/test/lib/vedeu/views/default_attributes_test.rb +5 -5
- data/test/lib/vedeu/views/view_test.rb +5 -2
- data/test/test_helper.rb +1 -1
- data/vedeu.gemspec +1 -1
- metadata +7 -4
@@ -26,8 +26,8 @@ module Vedeu
|
|
26
26
|
Vedeu::Templating::Decoder.process(stream)
|
27
27
|
|
28
28
|
else
|
29
|
-
Vedeu::Views::Stream.new(colour:
|
30
|
-
style:
|
29
|
+
Vedeu::Views::Stream.new(colour: stream_colour,
|
30
|
+
style: stream_style,
|
31
31
|
value: stream)
|
32
32
|
|
33
33
|
end
|
@@ -54,24 +54,22 @@ module Vedeu
|
|
54
54
|
# Return the interface colours if a name option is set,
|
55
55
|
# otherwise use the default colours.
|
56
56
|
#
|
57
|
-
# @return [Vedeu::Colours::Colour|Hash<Symbol => Symbol>]
|
58
|
-
def
|
59
|
-
return interface.colour if
|
57
|
+
# @return [Vedeu::Colours::Colour|Hash<Symbol => NilClass,String,Symbol>]
|
58
|
+
def stream_colour
|
59
|
+
return interface.colour if name
|
60
60
|
|
61
|
-
|
62
|
-
background: :default,
|
63
|
-
foreground: :default,
|
64
|
-
}
|
61
|
+
default[:colour]
|
65
62
|
end
|
66
63
|
|
67
|
-
#
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
64
|
+
# @return [Hash<Symbol => Hash<Symbol => Symbol>,Symbol>]
|
65
|
+
def default
|
66
|
+
{
|
67
|
+
colour: {
|
68
|
+
background: :default,
|
69
|
+
foreground: :default,
|
70
|
+
},
|
71
|
+
style: :normal,
|
72
|
+
}
|
75
73
|
end
|
76
74
|
|
77
75
|
# Returns the interface by name.
|
@@ -80,7 +78,7 @@ module Vedeu
|
|
80
78
|
def interface
|
81
79
|
Vedeu.interfaces.by_name(name)
|
82
80
|
end
|
83
|
-
|
81
|
+
alias interface? interface
|
84
82
|
|
85
83
|
# @return [String|Symbol]
|
86
84
|
def name
|
@@ -95,6 +93,16 @@ module Vedeu
|
|
95
93
|
line.split(/({{\s*[^}]+\s*}})/)
|
96
94
|
end
|
97
95
|
|
96
|
+
# Return the interface style(s) if a name option is set,
|
97
|
+
# otherwise use the default style.
|
98
|
+
#
|
99
|
+
# @return [Symbol]
|
100
|
+
def stream_style
|
101
|
+
return interface.style if name
|
102
|
+
|
103
|
+
default[:style]
|
104
|
+
end
|
105
|
+
|
98
106
|
# Convert the content into an array of strings without the line
|
99
107
|
# ending character.
|
100
108
|
#
|
@@ -15,8 +15,8 @@ module Vedeu
|
|
15
15
|
:height,
|
16
16
|
:width
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
alias tyn height
|
19
|
+
alias txn width
|
20
20
|
|
21
21
|
# Opens a terminal screen in either `raw` or `cooked` mode. On
|
22
22
|
# exit, attempts to restore the screen. See
|
@@ -51,7 +51,7 @@ module Vedeu
|
|
51
51
|
console.print(stream)
|
52
52
|
end
|
53
53
|
end
|
54
|
-
|
54
|
+
alias write output
|
55
55
|
|
56
56
|
# {include:file:docs/dsl/by_method/resize.md}
|
57
57
|
# @return [Boolean]
|
@@ -140,8 +140,8 @@ module Vedeu
|
|
140
140
|
def origin
|
141
141
|
1
|
142
142
|
end
|
143
|
-
|
144
|
-
|
143
|
+
alias tx origin
|
144
|
+
alias ty origin
|
145
145
|
|
146
146
|
# Returns a tuple containing the height and width of the current
|
147
147
|
# terminal.
|
data/lib/vedeu/version.rb
CHANGED
data/lib/vedeu/views/chars.rb
CHANGED
@@ -18,9 +18,9 @@ module Vedeu
|
|
18
18
|
deputy Vedeu::DSL::View
|
19
19
|
entity Vedeu::Views::View
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
alias views value
|
22
|
+
alias views= value=
|
23
|
+
alias views? value?
|
24
24
|
|
25
25
|
# Returns a new instance of Vedeu::Views::Composition.
|
26
26
|
#
|
@@ -41,7 +41,7 @@ module Vedeu
|
|
41
41
|
def add(child)
|
42
42
|
@value = value.add(child)
|
43
43
|
end
|
44
|
-
|
44
|
+
alias << add
|
45
45
|
|
46
46
|
# @return [Hash<Symbol => void>]
|
47
47
|
def attributes
|
@@ -23,7 +23,7 @@ module Vedeu
|
|
23
23
|
# @!attribute [r] truncate
|
24
24
|
# @return [Boolean]
|
25
25
|
attr_reader :truncate
|
26
|
-
|
26
|
+
alias truncate? truncate
|
27
27
|
|
28
28
|
# @!attribute [r] width
|
29
29
|
# @return [Fixnum|NilClass]
|
@@ -32,7 +32,7 @@ module Vedeu
|
|
32
32
|
# @!attribute [r] wordwrap
|
33
33
|
# @return [Boolean]
|
34
34
|
attr_reader :wordwrap
|
35
|
-
|
35
|
+
alias wordwrap? wordwrap
|
36
36
|
|
37
37
|
# @return [Hash<Symbol => void>]
|
38
38
|
def attributes
|
data/lib/vedeu/views/line.rb
CHANGED
@@ -37,8 +37,8 @@ module Vedeu
|
|
37
37
|
def_delegators :value,
|
38
38
|
:streams
|
39
39
|
|
40
|
-
|
41
|
-
|
40
|
+
alias streams= value=
|
41
|
+
alias streams? value?
|
42
42
|
|
43
43
|
# Returns a new instance of Vedeu::Views::Line.
|
44
44
|
#
|
@@ -61,7 +61,7 @@ module Vedeu
|
|
61
61
|
def add(child)
|
62
62
|
@value = value.add(child)
|
63
63
|
end
|
64
|
-
|
64
|
+
alias << add
|
65
65
|
|
66
66
|
# Returns an array of all the characters with formatting for
|
67
67
|
# this line.
|
@@ -69,7 +69,7 @@ module Vedeu
|
|
69
69
|
# @return [Array]
|
70
70
|
# @see Vedeu::Views::Stream
|
71
71
|
def chars
|
72
|
-
return [] unless
|
72
|
+
return [] unless streams?
|
73
73
|
|
74
74
|
@chars ||= streams.flat_map(&:chars)
|
75
75
|
end
|
@@ -81,7 +81,7 @@ module Vedeu
|
|
81
81
|
def eql?(other)
|
82
82
|
self.class == other.class && value == other.value
|
83
83
|
end
|
84
|
-
|
84
|
+
alias == eql?
|
85
85
|
|
86
86
|
# @return [NilClass|String|Symbol]
|
87
87
|
def name
|
@@ -104,7 +104,7 @@ module Vedeu
|
|
104
104
|
#
|
105
105
|
# @return [Fixnum]
|
106
106
|
def size
|
107
|
-
|
107
|
+
streams.map(&:size).inject(0, :+)
|
108
108
|
end
|
109
109
|
|
110
110
|
end # Line
|
data/lib/vedeu/views/lines.rb
CHANGED
data/lib/vedeu/views/stream.rb
CHANGED
@@ -39,10 +39,10 @@ module Vedeu
|
|
39
39
|
:chars,
|
40
40
|
:size
|
41
41
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
alias content value
|
43
|
+
alias text value
|
44
|
+
alias chars= value=
|
45
|
+
alias chars? value?
|
46
46
|
|
47
47
|
# @!attribute [w] value
|
48
48
|
# @return [String]
|
@@ -76,7 +76,7 @@ module Vedeu
|
|
76
76
|
self
|
77
77
|
end
|
78
78
|
end
|
79
|
-
|
79
|
+
alias << add
|
80
80
|
|
81
81
|
# An object is equal when its values are the same.
|
82
82
|
#
|
@@ -85,7 +85,7 @@ module Vedeu
|
|
85
85
|
def eql?(other)
|
86
86
|
self.class == other.class && value == other.value
|
87
87
|
end
|
88
|
-
|
88
|
+
alias == eql?
|
89
89
|
|
90
90
|
# @return [NilClass|String|Symbol]
|
91
91
|
def name
|
data/lib/vedeu/views/streams.rb
CHANGED
data/lib/vedeu/views/view.rb
CHANGED
@@ -38,13 +38,13 @@ module Vedeu
|
|
38
38
|
def_delegators :value,
|
39
39
|
:lines
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
alias lines= value=
|
42
|
+
alias lines? value?
|
43
43
|
|
44
44
|
# @!attribute [rw] cursor_visible
|
45
45
|
# @return [Boolean]
|
46
46
|
attr_accessor :cursor_visible
|
47
|
-
|
47
|
+
alias cursor_visible? cursor_visible
|
48
48
|
|
49
49
|
# @!attribute [rw] name
|
50
50
|
# @return [String|Symbol]
|
@@ -77,7 +77,7 @@ module Vedeu
|
|
77
77
|
def add(child)
|
78
78
|
@value = value.add(child)
|
79
79
|
end
|
80
|
-
|
80
|
+
alias << add
|
81
81
|
|
82
82
|
# @return [Hash]
|
83
83
|
def attributes
|
@@ -10,7 +10,7 @@ module Vedeu
|
|
10
10
|
|
11
11
|
let(:described) { Vedeu::Borders::Caption }
|
12
12
|
let(:instance) { described.new(_name, _value, horizontal) }
|
13
|
-
let(:_name) {
|
13
|
+
let(:_name) { :vedeu_borders_caption }
|
14
14
|
let(:_value) { 'Bismuth' }
|
15
15
|
let(:type) { :bottom_horizontal }
|
16
16
|
let(:horizontal) {
|
@@ -12,12 +12,11 @@ module Vedeu
|
|
12
12
|
let(:instance) { described.new(model, client) }
|
13
13
|
let(:model) { Vedeu::Borders::Border.new(attributes) }
|
14
14
|
let(:client) {}
|
15
|
-
let(:attributes) { { name:
|
15
|
+
let(:attributes) { { name: _name } }
|
16
16
|
let(:boolean) { true }
|
17
|
+
let(:_name) { :vedeu_borders_dsl }
|
17
18
|
|
18
19
|
describe '.border' do
|
19
|
-
let(:_name) { 'Vedeu::Borders::DSL' }
|
20
|
-
|
21
20
|
after { Vedeu.borders.reset! }
|
22
21
|
|
23
22
|
subject { described.border(_name) { } }
|
@@ -10,7 +10,7 @@ module Vedeu
|
|
10
10
|
|
11
11
|
let(:described) { Vedeu::Borders::Title }
|
12
12
|
let(:instance) { described.new(_name, _value, horizontal) }
|
13
|
-
let(:_name) {
|
13
|
+
let(:_name) { :vedeu_borders_title }
|
14
14
|
let(:_value) { 'Aluminium' }
|
15
15
|
let(:horizontal) {
|
16
16
|
[
|
@@ -10,19 +10,18 @@ module Vedeu
|
|
10
10
|
|
11
11
|
let(:described) { Vedeu::Buffers::Buffer }
|
12
12
|
let(:instance) { described.new(attributes) }
|
13
|
-
let(:_name) { 'krypton' }
|
14
|
-
let(:back) {}
|
15
|
-
let(:front) {}
|
16
|
-
let(:previous) {}
|
17
|
-
let(:interface) {}
|
18
13
|
let(:attributes) {
|
19
14
|
{
|
20
|
-
name: _name,
|
21
15
|
back: back,
|
22
16
|
front: front,
|
17
|
+
name: _name,
|
23
18
|
previous: previous,
|
24
19
|
}
|
25
20
|
}
|
21
|
+
let(:back) {}
|
22
|
+
let(:front) {}
|
23
|
+
let(:_name) { :vedeu_buffers_buffer }
|
24
|
+
let(:previous) {}
|
26
25
|
|
27
26
|
describe '#initialize' do
|
28
27
|
it { instance.must_be_instance_of(described) }
|
@@ -31,7 +30,8 @@ module Vedeu
|
|
31
30
|
it { instance.instance_variable_get('@front').must_equal(front) }
|
32
31
|
it { instance.instance_variable_get('@previous').must_equal(previous) }
|
33
32
|
it do
|
34
|
-
instance.instance_variable_get('@repository')
|
33
|
+
instance.instance_variable_get('@repository')
|
34
|
+
.must_equal(Vedeu.buffers)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -92,6 +92,33 @@ module Vedeu
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
+
describe '#to_ast' do
|
96
|
+
subject { instance.to_ast }
|
97
|
+
|
98
|
+
context 'when there is no background' do
|
99
|
+
let(:colour) { '' }
|
100
|
+
let(:expected) { '' }
|
101
|
+
|
102
|
+
it { subject.must_equal(expected) }
|
103
|
+
end
|
104
|
+
|
105
|
+
context 'when there is a background' do
|
106
|
+
context 'when the background is an CSS/HTML value' do
|
107
|
+
let(:colour) { '#ff0000' }
|
108
|
+
let(:expected) { ':bg_ff0000' }
|
109
|
+
|
110
|
+
it { subject.must_equal(expected) }
|
111
|
+
end
|
112
|
+
|
113
|
+
context 'when the background is not a CSS/HTML value' do
|
114
|
+
let(:colour) { 233 }
|
115
|
+
let(:expected) { ':bg' }
|
116
|
+
|
117
|
+
it { subject.must_equal(expected) }
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
95
122
|
describe '#to_h' do
|
96
123
|
subject { instance.to_h }
|
97
124
|
|
@@ -92,6 +92,33 @@ module Vedeu
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
+
describe '#to_ast' do
|
96
|
+
subject { instance.to_ast }
|
97
|
+
|
98
|
+
context 'when there is no foreground' do
|
99
|
+
let(:colour) { '' }
|
100
|
+
let(:expected) { '' }
|
101
|
+
|
102
|
+
it { subject.must_equal(expected) }
|
103
|
+
end
|
104
|
+
|
105
|
+
context 'when there is a foreground' do
|
106
|
+
context 'when the foreground is an CSS/HTML value' do
|
107
|
+
let(:colour) { '#ff0000' }
|
108
|
+
let(:expected) { ':fg_ff0000' }
|
109
|
+
|
110
|
+
it { subject.must_equal(expected) }
|
111
|
+
end
|
112
|
+
|
113
|
+
context 'when the foreground is not a CSS/HTML value' do
|
114
|
+
let(:colour) { 233 }
|
115
|
+
let(:expected) { ':fg' }
|
116
|
+
|
117
|
+
it { subject.must_equal(expected) }
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
95
122
|
describe '#to_h' do
|
96
123
|
subject { instance.to_h }
|
97
124
|
|