Sha256: abe020cc58677f3f5b9e8d5af07798bb9ccc0e7e9ea2b8295dea1df85e06acfb

Contents?: true

Size: 423 Bytes

Versions: 4

Compression:

Stored size: 423 Bytes

Contents

module Tedium
  module Capybara
    module NodeElement
      def self.included(base)
        base.send(:alias_method, :original_set, :set)
        base.send(:alias_method, :set, :augmented_select)
      end

      def augmented_select(value)
        if tag_name == "select"
          find(:option_with_value_or_label, value).select_option
        else
          original_set(value)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tedium-0.0.4 lib/tedium/capybara/node_element.rb
tedium-0.0.3 lib/tedium/capybara/node_element.rb
tedium-0.0.2 lib/tedium/capybara/node_element.rb
tedium-0.0.1 lib/tedium/capybara/node_element.rb