Sha256: 14968da4531f3db61ffcff26c3d70f2a1c4644944b7fb748632afb0f6f0d098b

Contents?: true

Size: 309 Bytes

Versions: 97

Compression:

Stored size: 309 Bytes

Contents

require 'spec_helper'
require 'rainbow'

RSpec.describe 'uncolor method' do

  it 'strips ansi color escape code' do
    expect(Rainbow.uncolor("\e[35mhello\e[0mm")).to eq 'hellom'
  end

  it 'does not strip scroll down escape code' do
    expect(Rainbow.uncolor("\e[1Thello")).to eq "\e[1Thello"
  end

end

Version data entries

97 entries across 90 versions & 19 rubygems

Version Path
primary_connect_proto-0.20.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.20.0 vendor/bundle/ruby/3.0.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.19.0 vendor/bundle/ruby/3.0.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.18.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.18.0 vendor/bundle/ruby/3.0.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.17.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.17.0 vendor/bundle/ruby/3.0.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.12.1 vendor/bundle/ruby/2.7.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.10.2 vendor/bundle/ruby/2.7.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.10.1 vendor/bundle/ruby/2.7.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.9.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.8.2 vendor/bundle/ruby/2.7.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.8.1 vendor/bundle/ruby/2.7.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.8.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.7.3 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.7.2 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.7.1 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.7.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
primary_connect_proto-0.6.0 vendor/bundle/ruby/2.6.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/rainbow-3.0.0/spec/integration/uncolor_spec.rb