Skip to content

Commit

Permalink
Update check for osx/java sysex problem, increase sleep statements fo…
Browse files Browse the repository at this point in the history
…r jruby
  • Loading branch information
arirusso committed Feb 18, 2022
1 parent 568773f commit cc1d930
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion spec/integration/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/input_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down
11 changes: 7 additions & 4 deletions spec/integration/io_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"
Expand All @@ -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}"

Expand All @@ -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}"
Expand Down

0 comments on commit cc1d930

Please sign in to comment.