Class: RSpec::Core::Notifications::SeedNotification

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec/core/notifications.rb,
lib/rspec/core/notifications.rb

Overview

The SeedNotification holds the seed used to randomize examples and whether that seed has been used or not.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Fixnum) seed

the seed used to randomize ordering

Returns:

  • (Fixnum)

    the current value of seed

264
265
266
# File 'lib/rspec/core/notifications.rb', line 264
def seed
  @seed
end

- (Boolean) used=(value)

whether the seed has been used or not

Parameters:

  • value (Boolean)

    the value to set the attribute used to.

Returns:

  • (Boolean)

    the newly set value

264
265
266
# File 'lib/rspec/core/notifications.rb', line 264
def used=(value)
  @used = value
end

Instance Method Details

- (String) fully_formatted

Returns The seed information fully formatted in the way that RSpec's built-in formatters emit.

Returns:

  • (String)

    The seed information fully formatted in the way that RSpec's built-in formatters emit.

275
276
277
# File 'lib/rspec/core/notifications.rb', line 275
def fully_formatted
  "\nRandomized with seed #{seed}\n"
end

- (Boolean) seed_used?

Returns has the seed been used?

Returns:

  • (Boolean)

    has the seed been used?

268
269
270
# File 'lib/rspec/core/notifications.rb', line 268
def seed_used?
  !!used
end