diff --git a/lib/table_cloth/configuration.rb b/lib/table_cloth/configuration.rb index 8ccab8f..663476b 100644 --- a/lib/table_cloth/configuration.rb +++ b/lib/table_cloth/configuration.rb @@ -1,8 +1,8 @@ module TableCloth class Configuration - OPTIONS = %w(table thead th tbody tr td).map(&:to_sym) + ELEMENT_OPTIONS = %w(table thead th tbody tr td).map(&:to_sym) - OPTIONS.each do |option| + ELEMENT_OPTIONS.each do |option| class_eval <<-OPTION, __FILE__, __LINE__+1 def #{option} @#{option}_option ||= ActiveSupport::OrderedOptions.new diff --git a/spec/lib/configuration_spec.rb b/spec/lib/configuration_spec.rb index 2ada3ec..b45f395 100644 --- a/spec/lib/configuration_spec.rb +++ b/spec/lib/configuration_spec.rb @@ -2,11 +2,12 @@ describe TableCloth::Configuration do subject { TableCloth::Configuration.new } - let(:options) { TableCloth::Configuration::OPTIONS } - it "has accessors for all options" do - options.each do |option| - expect(subject).to respond_to option + context "element options" do + TableCloth::Configuration::ELEMENT_OPTIONS.each do |option| + it "has an accessor for #{option}" do + expect(subject).to respond_to option + end end end