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

Inherits:
Struct
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/notifications.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/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

Methods inherited from Struct

#as_json

Instance Attribute Details

#seedFixnum

the seed used to randomize ordering

Returns:

  • (Fixnum)

    the current value of seed



269
270
271
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/notifications.rb', line 269

def seed
  @seed
end

#used=(value) ⇒ Boolean

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



269
270
271
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/notifications.rb', line 269

def used=(value)
  @used = value
end

Instance Method Details

#fully_formattedString

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.



280
281
282
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/notifications.rb', line 280

def fully_formatted
  "\nRandomized with seed #{seed}\n"
end

#seed_used?Boolean

Returns has the seed been used?.

Returns:

  • (Boolean)

    has the seed been used?



273
274
275
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/notifications.rb', line 273

def seed_used?
  !!used
end