# File lib/capybara/xpath.rb, line 159 def extract_postfix(options) options.inject("") do |postfix, (key, value)| case key when :value then postfix += "[@value=#{s(value)}]" when :text then postfix += "[text()=#{s(value)}]" when :checked then postfix += "[@checked]" when :unchecked then postfix += "[not(@checked)]" when :options then postfix += value.map { |o| "[.//option/text()=#{s(o)}]" }.join when :selected then postfix += [value].flatten.map { |o| "[.//option[@selected]/text()=#{s(o)}]" }.join end postfix end end