Class: Tomo::Testing::CLITester
- Inherits:
-
Object
- Object
- Tomo::Testing::CLITester
- Includes:
- Local, LogCapturing
- Defined in:
- lib/tomo/testing/cli_tester.rb
Instance Method Summary collapse
- #in_temp_dir ⇒ Object
-
#initialize ⇒ CLITester
constructor
A new instance of CLITester.
- #run(*args, raise_on_error: true) ⇒ Object
Methods included from LogCapturing
Methods included from Local
#capture, capture, in_temp_dir, #with_tomo_gemfile, with_tomo_gemfile
Constructor Details
#initialize ⇒ CLITester
Returns a new instance of CLITester.
11 12 13 |
# File 'lib/tomo/testing/cli_tester.rb', line 11 def initialize @token = SecureRandom.hex(8) end |
Instance Method Details
#in_temp_dir ⇒ Object
15 16 17 |
# File 'lib/tomo/testing/cli_tester.rb', line 15 def in_temp_dir(&) super(token, &) end |
#run(*args, raise_on_error: true) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/tomo/testing/cli_tester.rb', line 19 def run(*args, raise_on_error: true) in_temp_dir do restoring_defaults do capturing_logger_output do handling_exit(raise_on_error) do CLI.new.call(args.flatten) end end end end end |