Sha256: 4eb54e313f617c8d2983b01d6955172637361b9ca32ecc31bf3b15a372fce082

Contents?: true

Size: 338 Bytes

Versions: 3

Compression:

Stored size: 338 Bytes

Contents

require "./lib/kommando"

calls = []
calls_matchdata = []

k = Kommando.new("ping -c 3 -i 0.2 127.0.0.1", {
  output: false
})

k.out.once("bytes") do
  calls << :first
end

k.out.once(/from (\d+)\./) do |m|
  calls_matchdata << m[1]
end

k.run

raise "err" unless calls == [:first]
raise "err matchdata" unless calls_matchdata == ["127"]

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kommando-0.1.2 examples/out_once.rb
kommando-0.1.1 examples/out_once.rb
kommando-0.1.0 examples/out_once.rb