Module: TestBench::Output::Writer::Styling
- Defined in:
- lib/test_bench/output/writer.rb
Constant Summary collapse
- Error =
Class.new(RuntimeError)
Class Method Summary collapse
- .default ⇒ Object
- .default! ⇒ Object
- .detect ⇒ Object
- .off ⇒ Object
- .on ⇒ Object
- .styling?(policy, console) ⇒ Boolean
Class Method Details
.default ⇒ Object
252 253 254 255 256 257 258 |
# File 'lib/test_bench/output/writer.rb', line 252 def self.default policy = ENV.fetch('TEST_BENCH_OUTPUT_STYLING') do return default! end policy.to_sym end |
.default! ⇒ Object
260 261 262 |
# File 'lib/test_bench/output/writer.rb', line 260 def self.default! :detect end |
.detect ⇒ Object
250 |
# File 'lib/test_bench/output/writer.rb', line 250 def self.detect = :detect |
.off ⇒ Object
249 |
# File 'lib/test_bench/output/writer.rb', line 249 def self.off = :off |
.on ⇒ Object
248 |
# File 'lib/test_bench/output/writer.rb', line 248 def self.on = :on |
.styling?(policy, console) ⇒ Boolean
235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/test_bench/output/writer.rb', line 235 def self.styling?(policy, console) case policy when on true when off false when detect console ? true : false else raise Error, "Unknown styling policy #{policy.inspect}" end end |