Sha256: 0be41f7211039200e657e0e30244ff1f10265d313a9c18a136a8b58f0e2fc48e

Contents?: true

Size: 696 Bytes

Versions: 6

Compression:

Stored size: 696 Bytes

Contents

describe "Asynchronous helpers" do
  let(:foo) { 100 }

  before do
    @model = Object.new
  end

  async "can run examples async" do
    async do
      1.should == 1
    end
  end

  async "can access let() helpers and before() helpers" do
    async do
      foo.should eq(100)
      @model.should be_kind_of(Object)
    end
  end

  async "can finish running after a long delay" do
    obj = [1, 2, 3, 4]

    delay(1) do
      async { obj.should == [1, 2, 3, 4] }
    end
  end

  async "should make example fail before async block reached" do
    expect {
      expect(:foo).to eq(:baz)
    }.to raise_error(Exception)

    delay(0) do
      async { expect(42).to eq(42) }
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
opal-rspec-cj-0.4.4 spec/async_spec.rb
opal-rspec-0.4.3 spec/async_spec.rb
opal-rspec-0.4.2 spec/async_spec.rb
opal-rspec-0.4.1 spec/async_spec.rb
opal-rspec-0.4.0 spec/async_spec.rb
opal-rspec-0.4.0.beta4 spec/async_spec.rb