类: RSpec::Core::Notifications::SeedNotification

继承
Struct
  • Object
显示全部
定义于
lib/rspec/core/notifications.rb,
lib/rspec/core/notifications.rb

概述

SeedNotification 类存储用于随机化示例的种子值,以及该种子是否已使用。

实例属性概要 折叠

实例方法概要 折叠

实例属性详情

#seedFixnum

用于随机化顺序的种子值

返回值

  • (Fixnum)

    seed 的当前值

271
272
273
# File 'lib/rspec/core/notifications.rb', line 271
def seed
  @seed
end

#used=(value) ⇒Boolean

种子是否已使用

参数

  • value (Boolean)

    要设置的用于属性的值。

返回值

  • (Boolean)

    新设置的值

271
272
273
# File 'lib/rspec/core/notifications.rb', line 271
def used=(value)
  @used = value
end

实例方法详情

#fully_formattedString

返回值 以 RSpec 内置格式化器输出的方式,完整格式化种子信息。

返回值

  • (String)

    以 RSpec 内置格式化器输出的方式,完整格式化种子信息。

282
283
284
# File 'lib/rspec/core/notifications.rb', line 282
def fully_formatted
  "\nRandomized with seed #{seed}\n"
end

#seed_used?Boolean

返回值 种子是否已使用?。

返回值

  • (Boolean)

    种子是否已使用?

275
276
277
# File 'lib/rspec/core/notifications.rb', line 275
def seed_used?
  !!used
end