Module: Fried::Test::Telemetry
- Included in:
- Autorun::Substitute, Directory::GetFilesByPattern::Substitute, LoadTestFiles::Substitute, LoadTestsPath::Substitute
- Defined in:
- lib/fried/test/telemetry.rb
Defined Under Namespace
Classes: Record
Instance Method Summary collapse
- #record(signal, data = nil) ⇒ Object
- #recorded?(signal) ⇒ Boolean
- #recorded_times?(signal, amount) ⇒ Boolean
- #recorded_with?(signal, data) ⇒ Boolean
Instance Method Details
#record(signal, data = nil) ⇒ Object
8 9 10 11 12 |
# File 'lib/fried/test/telemetry.rb', line 8 def record(signal, data = nil) @__telemetry_records__ ||= [] time = Time.now.utc @__telemetry_records__ << Record.new(signal, time, data) end |
#recorded?(signal) ⇒ Boolean
14 15 16 17 18 |
# File 'lib/fried/test/telemetry.rb', line 14 def recorded?(signal) @__telemetry_records__.any? do |recorded| recorded.signal == signal end end |
#recorded_times?(signal, amount) ⇒ Boolean
27 28 29 30 31 |
# File 'lib/fried/test/telemetry.rb', line 27 def recorded_times?(signal, amount) @__telemetry_records__.count do |recorded| recorded.signal == signal end end |
#recorded_with?(signal, data) ⇒ Boolean
20 21 22 23 24 25 |
# File 'lib/fried/test/telemetry.rb', line 20 def recorded_with?(signal, data) @__telemetry_records__.any? do |recorded| recorded.signal == signal && recorded.data == data end end |