module Autobots

  # An object that holds runtime settings.
  #
  # Furthermore, Minitest doesn't provide any good way of passing a hash of
  # options to each test.
  #
  # TODO: We're importing ActiveSupport's extensions to Hash, which means that
  # we'll be amending the way Hash objects work; once AS updates themselves to
  # ruby 2.0 refinements, let's move towards that.
  class Settings

    def initialize
      @hsh = {}
    end

    def inspect
      settings = self.class.public_instance_methods(false).sort.map(&:inspect).join(', ')
      "#<Autobots::Settings #{settings}>"
    end

    def auto_finalize?
      hsh.fetch(:auto_finalize, true)
    end

    def connector
      hsh.fetch(:connector, :ghost).to_s
    end

    def env
      hsh.fetch(:env, :qa).to_s
    end

    def io
      hsh[:io]
    end

    def merge!(other)
      hsh.merge!(other.symbolize_keys)
      self
    end

    def parallel?
      hsh.fetch(:parallel, false)
    end

    def raw_arguments
      hsh.fetch(:args, nil).to_s
    end

    def reuse_driver?
      hsh.fetch(:reuse_driver, false)
    end

    def seed
      hsh.fetch(:seed, nil).to_i
    end

    def tags
      hsh[:tags] ||= []
    end

    def verbose?
      verbosity_level > 0
    end

    def verbosity_level
      hsh.fetch(:verbosity_level, 0).to_i
    end

    private
    attr_reader :hsh

  end

end

module Autobots

  # An object that holds runtime settings.
  #
  # Furthermore, Minitest doesn't provide any good way of passing a hash of
  # options to each test.
  #
  # TODO: We're importing ActiveSupport's extensions to Hash, which means that
  # we'll be amending the way Hash objects work; once AS updates themselves to
  # ruby 2.0 refinements, let's move towards that.
  class Settings

    def initialize
      @hsh = {}
    end

    def inspect
      settings = self.class.public_instance_methods(false).sort.map(&:inspect).join(', ')
      "#<Autobots::Settings #{settings}>"
    end

    def auto_finalize?
      hsh.fetch(:auto_finalize, true)
    end

    def connector
      hsh.fetch(:connector, :firefox).to_s
    end

    def env
      hsh.fetch(:env, :qa).to_s
    end

    def io
      hsh[:io]
    end

    def merge!(other)
      hsh.merge!(other.symbolize_keys)
      self
    end

    def parallel?
      hsh.fetch(:parallel, false)
    end

    def raw_arguments
      hsh.fetch(:args, nil).to_s
    end

    def reuse_driver?
      hsh.fetch(:reuse_driver, false)
    end

    def seed
      hsh.fetch(:seed, nil).to_i
    end

    def tags
      hsh[:tags] ||= []
    end

    def verbose?
      verbosity_level > 0
    end

    def verbosity_level
      hsh.fetch(:verbosity_level, 0).to_i
    end

    private
    attr_reader :hsh

  end

end

Change default connector to firefox instead of ghost since everyone uses it during development
[PH][000000] Change default connector to firefox instead of ghost since everyone uses it during development
