Sha256: 2c1c16e42b739f6f05578e23b9d6f42e207b3960011b0234bf8c4192d43e15b6

Contents?: true

Size: 926 Bytes

Versions: 15

Compression:

Stored size: 926 Bytes

Contents

module Guard
  class RSpec < Plugin
    module Options
      DEFAULTS = {
        all_on_start:    false,
        all_after_pass:  false,
        run_all:         { message: "Running all specs" },
        failed_mode:     :none,  # :keep and :focus are other posibilities
        spec_paths:      %w(spec),
        cmd:             nil,
        cmd_additional_args: nil,
        launchy:         nil,
        notification:    true,
        title:           "RSpec results"
      }

      class << self
        def with_defaults(options = {})
          _deep_merge(DEFAULTS, options)
        end

        private

        def _deep_merge(hash1, hash2)
          hash1.merge(hash2) do |_key, oldval, newval|
            if oldval.instance_of?(Hash) && newval.instance_of?(Hash)
              _deep_merge(oldval, newval)
            else
              newval
            end
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
mastermind_adeybee-0.1.4 vendor/bundle/ruby/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec/options.rb
mastermind_adeybee-0.1.3 vendor/bundle/ruby/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec/options.rb
mastermind_adeybee-0.1.2 vendor/bundle/ruby/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec/options.rb
mastermind_adeybee-0.1.1 vendor/bundle/ruby/2.2.0/gems/guard-rspec-4.6.4/lib/guard/rspec/options.rb
geminfo-0.1.0 path/gems/guard-rspec-4.6.4/lib/guard/rspec/options.rb
guard-rspec-4.6.4 lib/guard/rspec/options.rb
guard-rspec-4.6.3 lib/guard/rspec/options.rb
guard-rspec-4.6.2 lib/guard/rspec/options.rb
guard-rspec-4.6.1 lib/guard/rspec/options.rb
guard-rspec-4.6.0 lib/guard/rspec/options.rb
guard-rspec-4.5.2 lib/guard/rspec/options.rb
guard-rspec-4.5.1 lib/guard/rspec/options.rb
guard-rspec-4.5.0 lib/guard/rspec/options.rb
guard-rspec-4.4.2 lib/guard/rspec/options.rb
guard-rspec-4.4.1 lib/guard/rspec/options.rb