Sha256: f41708f861e55b6eed4cb4e30eb33e87a26e68b24d07f3d1c0a94c31ff58d4e6
Contents?: true
Size: 1.17 KB
Versions: 7
Compression:
Stored size: 1.17 KB
Contents
require_relative "./support/helpers" describe_recipe 'bluepill_test::default' do include BluepillTestHelpers describe "create a bluepill configuration file" do let(:config) { file(::File.join(node['bluepill']['conf_dir'], node['bluepill_test']['service_name'] + ".pill")) } it { config.must_exist } it "must be valid ruby" do assert(shell_out("ruby -c #{config.path}").exitstatus == 0) end end describe "runs the application as a service" do let(:service) { bluepill_service(node['bluepill_test']['service_name']) } it { service.must_be_enabled } it { service.must_be_running } end describe "spawn a netcat tcp client repeatedly" do let(:port) { node['bluepill_test']['tcp_server_listen_port'] } let(:secret) { node['bluepill_test']['secret'] } it "should receive a TCP connection from netcat" do TCPServer.open("localhost", port) do |server| client = server.accept assert_instance_of TCPSocket, client client_secret = client.gets.strip! assert_equal secret, client_secret client.close end end end end
Version data entries
7 entries across 7 versions & 1 rubygems