lib/capybara/rspec/matchers/base.rb in capybara-3.30.0 vs lib/capybara/rspec/matchers/base.rb in capybara-3.31.0

- old
+ new

@@ -10,23 +10,29 @@ class Base include ::Capybara::RSpecMatchers::Matchers::Compound if defined?(::Capybara::RSpecMatchers::Matchers::Compound) attr_reader :failure_message, :failure_message_when_negated - def initialize(*args, &filter_block) + def initialize(*args, **kw_args, &filter_block) @args = args.dup + @kw_args = kw_args || {} @filter_block = filter_block end private def session_query_args - if @args.last.is_a? Hash - @args.last[:session_options] = session_options - else - @args.push(session_options: session_options) - end + # if @args.last.is_a? Hash + # @args.last[:session_options] = session_options + # else + # @args.push(session_options: session_options) + # end @args + end + + def session_query_options + @kw_args[:session_options] = session_options + @kw_args end def session_options @context_el ||= nil if @context_el.respond_to? :session_options