lib/watirspec/implementation.rb in watir-6.6.1 vs lib/watirspec/implementation.rb in watir-6.6.2

- old
+ new

@@ -8,11 +8,12 @@ @guard_proc = nil end def initialize_copy(orig) super - @browser_args = Marshal.load( Marshal.dump(@browser_args)) + # Backward compatibility < Ruby 2.4 + @browser_args = browser_args.map { |arg| arg.is_a?(Symbol) ? arg : arg.dup } end def browser_class @browser_class || raise("browser_class not set") end @@ -35,12 +36,13 @@ end def inspect_args hash = browser_args.last desired_capabilities = hash.delete(:desired_capabilities) - caps = desired_capabilities.send(:capabilities) - string = "\tdriver: #{browser_args.first}\n" + string = '' hash.each { |arg| string << "#{arg.inspect}\n" } + return "#{string} default capabilities" unless desired_capabilities + string << "\tcapabilities:\n" caps.each { |k, v| string << "\t\t#{k}: #{v}\n"} hash[:desired_capabilities] = desired_capabilities string end