Sha256: 0e7ec4e13214d3de3be94e67fcb34c68b6e9a8896cbdfc664ef6c38e0f50e0c5

Contents?: true

Size: 1.18 KB

Versions: 32

Compression:

Stored size: 1.18 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')

describe ::Inch::Utils::UI do
  it "should trace" do
    out, err = capture_io do
      @instance = ::Inch::Utils::UI.new
      @instance.trace("Test")
    end
    refute out.empty?, "there should be no output"
    assert err.empty?, "there should be no errors"
  end

  it "should trace header" do
    out, err = capture_io do
      @instance = ::Inch::Utils::UI.new
      @instance.header("Test", :red)
    end
    refute out.empty?, "there should be no output"
    assert err.empty?, "there should be no errors"
  end

  it "should trace debug if ENV variable is set" do
    ENV['DEBUG'] = "1"
    out, err = capture_io do
      @instance = ::Inch::Utils::UI.new
      @instance.debug("Test")
    end
    ENV['DEBUG'] = nil
    refute out.empty?, "there should be no output"
    assert err.empty?, "there should be no errors"
  end

  it "should not trace debug if ENV variable is set" do
    refute ENV['DEBUG']
    out, err = capture_io do
      @instance = ::Inch::Utils::UI.new
      @instance.debug("Test")
    end
    assert out.empty?, "there should be no output"
    assert err.empty?, "there should be no errors"
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
inch-0.5.0.rc3 test/unit/utils/ui_test.rb
inch-0.5.0.rc2 test/unit/utils/ui_test.rb
inch-0.5.0.rc1 test/unit/utils/ui_test.rb
inch-0.4.6 test/unit/utils/ui_test.rb
inch-0.4.5 test/unit/utils/ui_test.rb
inch-0.4.4 test/unit/utils/ui_test.rb
inch-0.4.4.rc4 test/unit/utils/ui_test.rb
inch-0.4.4.rc3 test/unit/utils/ui_test.rb
inch-0.4.4.rc2 test/unit/utils/ui_test.rb
inch-0.4.4.rc1 test/unit/utils/ui_test.rb
inch-0.4.3 test/unit/utils/ui_test.rb
inch-0.4.3.rc2 test/unit/utils/ui_test.rb
inch-0.4.3.rc1 test/unit/utils/ui_test.rb
inch-0.4.2 test/unit/utils/ui_test.rb
inch-0.4.1 test/unit/utils/ui_test.rb
inch-0.4.0 test/unit/utils/ui_test.rb
inch-0.4.0.rc3 test/unit/utils/ui_test.rb
inch-0.4.0.rc2 test/unit/utils/ui_test.rb
inch-0.4.0.rc1 test/unit/utils/ui_test.rb
inch-0.3.4.rc1 test/unit/utils/ui_test.rb