lib/capybara/selector.rb in capybara-2.10.2 vs lib/capybara/selector.rb in capybara-2.11.0

- old
+ new

@@ -85,11 +85,11 @@ filter(:with) do |node, with| with.is_a?(Regexp) ? node.value =~ with : node.value == with.to_s end describe do |options| desc = String.new - (expression_filters - [:type]).each { |ef| desc << " with #{ef.to_s} #{options[ef]}" if options.has_key?(ef) } + (expression_filters - [:type]).each { |ef| desc << " with #{ef} #{options[ef]}" if options.has_key?(ef) } desc << " of type #{options[:type].inspect}" if options[:type] desc << " with value #{options[:with].to_s.inspect}" if options.has_key?(:with) desc end end @@ -194,11 +194,11 @@ filter(:disabled, :boolean, default: false, skip_if: :all) { |node, value| not(value ^ node.disabled?) } describe do |options| desc = String.new desc << " that is disabled" if options[:disabled] == true - expression_filters.each { |ef| desc << " with #{ef.to_s} #{options[ef]}" if options.has_key?(ef) } + desc << describe_all_expression_filters(options) desc end end ## @@ -242,11 +242,11 @@ with.is_a?(Regexp) ? node.value =~ with : node.value == with.to_s end describe do |options| desc = String.new - expression_filters.each { |ef| desc << " with #{ef.to_s} #{options[ef]}" if options.has_key?(ef) } + desc << describe_all_expression_filters(options) desc << " with value #{options[:with].to_s.inspect}" if options.has_key?(:with) desc end end @@ -275,11 +275,11 @@ filter(:option) { |node, value| node.value == value.to_s } describe do |options| desc = String.new desc << " with value #{options[:option].inspect}" if options[:option] - expression_filters.each { |ef| desc << " with #{ef.to_s} #{options[ef]}" if options.has_key?(ef) } + desc << describe_all_expression_filters(options) desc end end ## @@ -306,11 +306,11 @@ filter(:option) { |node, value| node.value == value.to_s } describe do |options| desc = String.new desc << " with value #{options[:option].inspect}" if options[:option] - expression_filters.each { |ef| desc << " with #{ef.to_s} #{options[ef]}" if options.has_key?(ef) } + desc << describe_all_expression_filters(options) desc end end ## @@ -362,11 +362,11 @@ describe do |options| desc = String.new desc << " with options #{options[:options].inspect}" if options[:options] desc << " with at least options #{options[:with_options].inspect}" if options[:with_options] desc << " with #{options[:selected].inspect} selected" if options[:selected] - expression_filters.each { |ef| desc << " with #{ef.to_s} #{options[ef]}" if options.has_key?(ef) } + desc << describe_all_expression_filters(options) desc end end ## @@ -415,10 +415,10 @@ filter_set(:_field, [:disabled, :multiple]) describe do |options| desc = String.new - expression_filters.each { |ef| desc << " with #{ef.to_s} #{options[ef]}" if options.has_key?(ef) } + desc << describe_all_expression_filters(options) desc end end ##