Sha256: 7c788735a5a20de7d8e8c822650d83732a2a68ec4fcbd7f59b58ef979b1b2cfd

Contents?: true

Size: 619 Bytes

Versions: 26

Compression:

Stored size: 619 Bytes

Contents

require 'xcpretty/term'

module XCPretty
  describe Term do
    it "marks unicode as unavailable" do
      Encoding.stub(:default_external).and_return(Encoding::ASCII)
      Term.unicode?.should be false
    end

    it "marks unicode as available" do
      Encoding.stub(:default_external).and_return(Encoding::UTF_8)
      Term.unicode?.should be true
    end

    it 'marks color as unavailable' do
      STDOUT.stub(:tty?).and_return(false)
      Term.color?.should be false
    end

    it 'marks color as available' do
      STDOUT.stub(:tty?).and_return(true)
      Term.color?.should be true
    end
  end
end

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
xcpretty-0.2.0 spec/xcpretty/term_spec.rb
xcpretty-bb-0.1.12.bb5 spec/xcpretty/term_spec.rb
xcpretty-bb-0.1.12.bb4 spec/xcpretty/term_spec.rb
xcpretty-bb-0.1.12.bb3 spec/xcpretty/term_spec.rb
xcpretty-bb-0.1.12.bb2 spec/xcpretty/term_spec.rb
xcpretty-bb-0.1.12.bb1 spec/xcpretty/term_spec.rb