Sha256: 50d84db3e478a2f76618eed01a1560e32e539ae61f83985e596e90f4834fc8a1

Contents?: true

Size: 503 Bytes

Versions: 9

Compression:

Stored size: 503 Bytes

Contents

require 'spec_helper'

require 'rocket_fuel/command_line_icon'

describe RocketFuel::CommandLineIcon do
  let(:utf_char) { "\u2713" }
  let(:fallback) { '[ok]' }

  let(:icon) { RocketFuel::CommandLineIcon.new(utf_char, fallback) }

  it 'renders the fallback if encoding is not supported' do
    icon.expects(:fallback?).returns(true)
    expect(icon.render).to eq(fallback)
  end
  
  it 'renders the icon if encoding is supported' do
    expect(icon.render).to eq(utf_char.encode('utf-8'))
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rocket_fuel-0.2.0 spec/rocket_fuel/command_line_icon_spec.rb
rocket_fuel-0.1.0 spec/rocket_fuel/command_line_icon_spec.rb
rocket_fuel-0.0.8 spec/rocket_fuel/command_line_icon_spec.rb
rocket_fuel-0.0.7 spec/rocket_fuel/command_line_icon_spec.rb
rocket_fuel-0.0.6 spec/rocket_fuel/command_line_icon_spec.rb
rocket_fuel-0.0.5 spec/rocket_fuel/command_line_icon_spec.rb
rocket_fuel-0.0.4 spec/rocket_fuel/command_line_icon_spec.rb
rocket_fuel-0.0.3 spec/rocket_fuel/command_line_icon_spec.rb
rocket_fuel-0.0.2 spec/rocket_fuel/command_line_icon_spec.rb