Port global text hints to the new conf
parent
923f346575
commit
1dc89ae76a
|
|
@ -13,7 +13,7 @@ module Squib
|
||||||
# @return [nil] Returns nothing
|
# @return [nil] Returns nothing
|
||||||
# @api public
|
# @api public
|
||||||
def hint(text: :off)
|
def hint(text: :off)
|
||||||
@text_hint = text
|
conf.text_hint = text
|
||||||
end
|
end
|
||||||
|
|
||||||
# Sets various defaults for this deck. Defaults can be overriden by the commands themselves when that command supports it.
|
# Sets various defaults for this deck. Defaults can be overriden by the commands themselves when that command supports it.
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,10 @@ module Squib
|
||||||
@config_hash['text_hint']
|
@config_hash['text_hint']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def text_hint=(hint)
|
||||||
|
@config_hash['text_hint'] = hint
|
||||||
|
end
|
||||||
|
|
||||||
def progress_bars
|
def progress_bars
|
||||||
@config_hash['progress_bars']
|
@config_hash['progress_bars']
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe Squib::Deck do
|
||||||
|
|
||||||
|
context '#hint' do
|
||||||
|
|
||||||
|
it 'sets hinting to conf' do
|
||||||
|
mock_conf = double(Squib::Conf)
|
||||||
|
expect(mock_conf).to receive(:text_hint=).with(:cyan).once
|
||||||
|
Squib::Deck.new do
|
||||||
|
@conf = mock_conf
|
||||||
|
hint text: :cyan
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
Loading…
Reference in New Issue