Module: Mutineer::TestRunners::RSpecSeed::Watch

Defined in:
lib/mutineer/test_runners/rspec_seed.rb

Overview

Prepended on RSpec::Core::Configuration. Records a seed the suite sets, from the command, SPEC_OPTS, .rspec, or the spec helper.

Instance Method Summary collapse

Instance Method Details

#force(hash) ⇒ void

This method returns an undefined value.

CLI, SPEC_OPTS and .rspec arrive here. --seed is passed as an order of rand:N.

Parameters:

  • hash (Hash)


106
107
108
109
# File 'lib/mutineer/test_runners/rspec_seed.rb', line 106

def force(hash)
  mark_seed_explicit if hash.key?(:seed) || RSpecSeed.embedded_seed?(hash[:order])
  super
end

#mark_seed_explicit ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Records that this configuration object set its own seed.



133
134
135
# File 'lib/mutineer/test_runners/rspec_seed.rb', line 133

def mark_seed_explicit
  @mutineer_seed_explicit = true
end

#order=(value) ⇒ void

This method returns an undefined value.

A spec helper's config.order = "rand:N".

Parameters:

  • value (Object)


124
125
126
127
# File 'lib/mutineer/test_runners/rspec_seed.rb', line 124

def order=(value)
  mark_seed_explicit if RSpecSeed.embedded_seed?(value)
  super
end

#seed=(value) ⇒ void

This method returns an undefined value.

A spec helper's config.seed =.

Parameters:

  • value (Object)


115
116
117
118
# File 'lib/mutineer/test_runners/rspec_seed.rb', line 115

def seed=(value)
  mark_seed_explicit unless RSpecSeed.pinning?
  super
end