diff --git a/spec/integration/helper.rb b/spec/integration/helper.rb index 400630e..07b941c 100644 --- a/spec/integration/helper.rb +++ b/spec/integration/helper.rb @@ -9,7 +9,7 @@ module Integration module_function def sysex_ok? - ENV['_system_name'] != 'OSX' || !RUBY_PLATFORM.include?('java') + !RUBY_PLATFORM.include?('java') || RbConfig::CONFIG["host_os"] != 'darwin' end def devices diff --git a/spec/integration/input_spec.rb b/spec/integration/input_spec.rb index 3073b2e..e7701df 100644 --- a/spec/integration/input_spec.rb +++ b/spec/integration/input_spec.rb @@ -8,7 +8,7 @@ let(:output) { SpecHelper::Integration.devices[:output].open } let(:messages) { SpecHelper::Integration.numeric_messages } before do - sleep 0.1 + sleep 0.3 input.buffer.clear end @@ -24,7 +24,7 @@ p "sending: #{message}" output.puts(message) sent_bytes += message - sleep 0.1 + sleep 0.3 buffer = input.buffer.map { |m| m[:data] }.flatten p "received: #{buffer}" expect(buffer).to eq(sent_bytes) diff --git a/spec/integration/io_spec.rb b/spec/integration/io_spec.rb index 8a62e5c..95ff435 100644 --- a/spec/integration/io_spec.rb +++ b/spec/integration/io_spec.rb @@ -6,7 +6,10 @@ # these tests assume that TestOutput is connected to TestInput let(:input) { SpecHelper::Integration.devices[:input].open } let(:output) { SpecHelper::Integration.devices[:output].open } - + before do + sleep 0.3 + input.buffer.clear + end after do input.close output.close @@ -23,7 +26,7 @@ p "sending: #{message}" output.puts(message) - sleep(0.1) + sleep 0.3 received = input.gets.map { |m| m[:data] }.flatten p "received: #{received}" @@ -46,7 +49,7 @@ p "sending: #{message}" output.puts(message) - sleep(0.1) + sleep 0.3 received = input.gets_bytestr.map { |m| m[:data] }.flatten.join p "received: #{received}" @@ -69,7 +72,7 @@ p "sending: #{message.inspect}" output.puts(message) - sleep(0.1) + sleep 0.3 received = input.gets.map { |m| m[:data] }.flatten p "received: #{received}"