Port global text hints to the new conf

dev
Andy Meneely 2015-04-28 21:01:49 -04:00
parent 923f346575
commit 1dc89ae76a
3 changed files with 23 additions and 1 deletions

View File

@ -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.

View File

@ -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

View File

@ -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