From e7ed37d5b29df1f07249a7f1472017d6f506b02b Mon Sep 17 00:00:00 2001 From: Abinoam Praxedes Marques Jr Date: Fri, 27 Feb 2015 12:17:29 -0300 Subject: Begin implementation of HighLine::Style.clear_index There was a commented HighLine::Style.clear_index on teardown of tc_style.rb tests. Begin implementation of it preserving builtin styles. This is important to ensure a clean enviroment for each test. --- lib/highline/style.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/highline/style.rb') diff --git a/lib/highline/style.rb b/lib/highline/style.rb index 3f83527..92f0b84 100755 --- a/lib/highline/style.rb +++ b/lib/highline/style.rb @@ -54,6 +54,11 @@ class HighLine style end + def self.clear_index + # reset to builtin only styles + @@styles = list.select { |name, style| style.builtin } + end + def self.rgb_hex(*colors) colors.map do |color| color.is_a?(Numeric) ? '%02x'%color : color.to_s -- cgit v1.2.1