Sha256: 753b1a44b748f1ba9d3bac4edaf24cc93cd802aff65d403dd9c3692916519637

Contents?: true

Size: 663 Bytes

Versions: 2

Compression:

Stored size: 663 Bytes

Contents

require 'spec_helper'
require 'squib/args/unit_conversion'

describe Squib::Args::UnitConversion do

  it 'does nothing on just numbers'  do
    expect(subject.parse(20)).to eq(20)
  end

  it 'strips trailing whitespace' do
    expect(subject.parse('1in ')).to eq(300)
  end

  it 'is ok w/internal whitesapce' do
    expect(subject.parse('1 in')).to eq(300)
  end

  it 'does cm' do
    expect(subject.parse('1cm')).to eq(118.1102361)
    expect(subject.parse('1cm  ')).to eq(118.1102361)
  end

  it 'does mm' do
    expect(subject.parse('1mm')).to eq(11.81102361)
    expect(subject.parse('1mm  ')).to eq(11.81102361)
  end


end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
squib-0.12.0 spec/args/unit_conversion_spec.rb
squib-0.11.0 spec/args/unit_conversion_spec.rb