Sha256: 9e99aa2d65e8e7b2bfd1c43c2e682e27e521a6da0db86d1a9ce9a1dfae6e424c

Contents?: true

Size: 604 Bytes

Versions: 27

Compression:

Stored size: 604 Bytes

Contents

require 'test/unit'
require 'promise/v2'

class TestPromiseError < Test::Unit::TestCase
  def test_rejects_the_promise_with_the_given_error
    prom = PromiseV2.error(23)
    assert_equal(prom.error, 23)
    prom.rescue{} # Needed, otherwise we have an uncaught exception
  end

  def test_marks_the_promise_as_realized
    prom = PromiseV2.error(23)
    assert_equal(prom.realized?, true)
    prom.rescue{} # Needed, otherwise we have an uncaught exception
  end

  def test_marks_the_promise_as_rejected
    prom = PromiseV2.error(23)
    assert_equal(prom.rejected?, true)
    prom.rescue{}
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
opal-1.8.3.rc1 test/opal/promisev2/test_error.rb
opal-1.8.2 test/opal/promisev2/test_error.rb
opal-1.8.1 test/opal/promisev2/test_error.rb
opal-1.8.0 test/opal/promisev2/test_error.rb
opal-1.8.0.beta1 test/opal/promisev2/test_error.rb
opal-1.7.4 test/opal/promisev2/test_error.rb
opal-1.8.0.alpha1 test/opal/promisev2/test_error.rb
opal-1.7.3 test/opal/promisev2/test_error.rb
opal-1.7.2 test/opal/promisev2/test_error.rb
opal-1.7.1 test/opal/promisev2/test_error.rb
opal-1.7.0 test/opal/promisev2/test_error.rb
opal-1.7.0.rc1 test/opal/promisev2/test_error.rb
opal-1.6.1 test/opal/promisev2/test_error.rb
opal-1.6.0 test/opal/promisev2/test_error.rb
opal-1.6.0.rc1 test/opal/promisev2/test_error.rb
opal-1.6.0.alpha1 test/opal/promisev2/test_error.rb
opal-1.5.1 test/opal/promisev2/test_error.rb
opal-1.5.0 test/opal/promisev2/test_error.rb
opal-1.5.0.rc1 test/opal/promisev2/test_error.rb
opal-1.4.1 test/opal/promisev2/test_error.rb