Browse Source

Port global text hints to the new conf

dev
Andy Meneely 11 years ago
parent
commit
1dc89ae76a
  1. 2
      lib/squib/api/settings.rb
  2. 4
      lib/squib/conf.rb
  3. 18
      spec/api/api_settings_spec.rb

2
lib/squib/api/settings.rb

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

4
lib/squib/conf.rb

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

18
spec/api/api_settings_spec.rb

@ -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…
Cancel
Save