Module: TestBench::Output::Detail
- Defined in:
- lib/test_bench/output/output.rb
Constant Summary collapse
- Error =
Class.new(RuntimeError)
Class Method Summary collapse
- .default ⇒ Object
- .default! ⇒ Object
- .detail?(policy, mode) ⇒ Boolean
- .failure ⇒ Object
- .off ⇒ Object
- .on ⇒ Object
Class Method Details
.default ⇒ Object
322 323 324 325 326 327 328 |
# File 'lib/test_bench/output/output.rb', line 322 def self.default policy = ENV.fetch('TEST_BENCH_DETAIL') do return default! end policy.to_sym end |
.default! ⇒ Object
330 331 332 |
# File 'lib/test_bench/output/output.rb', line 330 def self.default! :failure end |
.detail?(policy, mode) ⇒ Boolean
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/test_bench/output/output.rb', line 301 def self.detail?(policy, mode) case policy when on true when off false when failure if mode == Mode.failing || mode == Mode.initial true else false end else raise Error, "Unknown detail policy #{policy.inspect}" end end |
.failure ⇒ Object
320 |
# File 'lib/test_bench/output/output.rb', line 320 def self.failure = :failure |
.off ⇒ Object
319 |
# File 'lib/test_bench/output/output.rb', line 319 def self.off = :off |
.on ⇒ Object
318 |
# File 'lib/test_bench/output/output.rb', line 318 def self.on = :on |