diff --git a/lib/squib/api/settings.rb b/lib/squib/api/settings.rb index 3a9eb2c..f02f8e1 100644 --- a/lib/squib/api/settings.rb +++ b/lib/squib/api/settings.rb @@ -13,7 +13,7 @@ module Squib # @return [nil] Returns nothing # @api public def hint(text: :off) - @text_hint = text + conf.text_hint = text end # Sets various defaults for this deck. Defaults can be overriden by the commands themselves when that command supports it. diff --git a/lib/squib/conf.rb b/lib/squib/conf.rb index 6de5c9c..b7de3d3 100644 --- a/lib/squib/conf.rb +++ b/lib/squib/conf.rb @@ -72,6 +72,10 @@ module Squib @config_hash['text_hint'] end + def text_hint=(hint) + @config_hash['text_hint'] = hint + end + def progress_bars @config_hash['progress_bars'] end diff --git a/spec/api/api_settings_spec.rb b/spec/api/api_settings_spec.rb new file mode 100644 index 0000000..ae14725 --- /dev/null +++ b/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 \ No newline at end of file