Sha256: 16d152cec92c0640bbd38634cf20bdd27c7b66e78014e5abf77e07cf596da51f

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

require 'test/unit'
require 'test/zentest_assertions'

class AssertionsTest < Test::Unit::TestCase

  def test_assert_empty
    assert_empty []

    assert_raise Test::Unit::AssertionFailedError do
      assert_empty [true]
    end
  end

  def test_deny
    deny false
    deny nil

    assert_raise Test::Unit::AssertionFailedError do
      deny true
    end
  end

  def test_deny_equal
    deny_equal true, false
    
    assert_raise Test::Unit::AssertionFailedError do
      deny_equal true, true
    end
  end

  def test_deny_empty
    deny_empty [true]

    assert_raise Test::Unit::AssertionFailedError do
      deny_empty []
    end
  end

  def test_assert_includes
    assert_includes [true], true

    assert_raise Test::Unit::AssertionFailedError do
      assert_includes [true], false
    end
  end

  def test_deny_includes
    deny_includes [true], false

    assert_raise Test::Unit::AssertionFailedError do
      deny_includes [true], true
    end
  end

  def test_util_capture
    out, err = util_capture do
      puts 'out'
      $stderr.puts 'err'
    end

    assert_equal "out\n", out.string
    assert_equal "err\n", err.string
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ZenTest-3.3.0 test/test_zentest_assertions.rb
ZenTest-3.4.0 test/test_zentest_assertions.rb
ZenTest-3.4.1 test/test_zentest_assertions.rb