Module: Anyt::Cli
- Defined in:
- lib/anyt/cli.rb
Overview
:nodoc:
Class Method Summary collapse
-
.run ⇒ Object
CLI entrypoint.
Class Method Details
.run ⇒ Object
CLI entrypoint
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/anyt/cli.rb', line 18 def run ActionCable.server.config.logger = Rails.logger = AnyCable.logger result = 1 $stdout.puts "Starting AnyT v#{Anyt::VERSION} (pid: #{Process.pid})\n" begin # "Enable" AnyCable as early as possible to activate all the features in tests unless Anyt.config.use_action_cable ActionCable.server.config.cable = {"adapter" => "any_cable"} require "anycable-rails" end # Load all test scenarios Tests.load_tests Rails.application.initialize! # Start RPC server (unless specified otherwise, e.g. when # we want to test Action Cable itself) unless @skip_rpc RPC.start if @only_rpc RPC.server.wait_till_terminated return end end # Start webosocket server under test Command.run # Run tests result = Tests.run ? 0 : 1 ensure RPC.stop unless @skip_rpc Command.stop end result end |