Sha256: cbd13060b209a2d51f4537bccf36526008d0d334635acaf3c8d83db08872bdfa

Contents?: true

Size: 605 Bytes

Versions: 7

Compression:

Stored size: 605 Bytes

Contents

require 'spec_helper'

describe Evrone::Common::Spawn::ReadTimeout do
  subject { described_class.new 0.2 }

  context "just created" do
    its(:value)     { should eq 0.2 }
    its(:happened?) { should be_false }
  end

  it "should be work" do
    subject.reset
    sleep 0.1
    expect(subject.happened?).to be_false

    subject.reset
    sleep 0.3
    expect(subject.happened?).to be_true
  end

  it "do nothing unless value" do
    expect(subject.happened?).to be_false
  end

  it "do nothing unless timeout" do
    subject.reset
    sleep 0.1
    expect(subject.happened?).to be_false
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
evrone-common-spawn-0.0.7 spec/lib/spawn/read_timeout_spec.rb
evrone-common-spawn-0.0.6 spec/lib/spawn/read_timeout_spec.rb
evrone-common-spawn-0.0.5 spec/lib/spawn/read_timeout_spec.rb
evrone-common-spawn-0.0.4 spec/lib/spawn/read_timeout_spec.rb
evrone-common-spawn-0.0.3 spec/lib/spawn/read_timeout_spec.rb
evrone-common-spawn-0.0.2 spec/lib/spawn/read_timeout_spec.rb
evrone-common-spawn-0.0.1 spec/lib/spawn/read_timeout_spec.rb