Sha256: 80dd728fc3c9c84894e82e63576a59af7c8b41cb8f74d554d0d3480dbdb7e9d7
Contents?: true
Size: 1.43 KB
Versions: 1
Compression:
Stored size: 1.43 KB
Contents
#!/usr/bin/ruby require_relative "../lib/httpotemkin" containers = Httpotemkin::Containers.new containers.add_server("rubygems") containers.add_server("api.rubygems") containers.add_server("obs") cmd = ARGV[0] if cmd == "status" containers.print_status elsif cmd == "up" puts "Starting server containers" containers.up elsif cmd == "down" puts "Stopping server containers" containers.down elsif cmd == "client" puts containers.run_client elsif cmd == "run" puts "Running tests" expected_output = File.read("expected_output") containers.up sleep 3 unless ENV["RUN_BY_RSPEC"] actual_output = containers.run_client puts "--- Start Test ---" puts actual_output puts "---- End Test ----" containers.down(save_logs: true) puts if actual_output == expected_output puts "Success." else puts "Failed." puts puts "Expected output:" puts expected_output puts puts "Actual output:" puts actual_output exit 1 end else if !cmd STDERR.puts "You need to provide a command" elsif cmd != "help" puts "Unknown command: #{cmd}" end puts "Usage: httpotemkin <command>" puts puts "Testing with HTTP mocks based on containers" puts puts "Commands:" puts " status - Show status of containers" puts " up - Start containers" puts " down - Stop containters" puts " client - Run client" puts " run - Run tests" puts " help - Show command line help" end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
httpotemkin-0.0.1 | bin/httpotemkin |