Sha256: 4ab1f1a33e4f89968b0b3e8962fc2f0f81db3c747e8f236d5d64a2a6edd74f34

Contents?: true

Size: 511 Bytes

Versions: 14

Compression:

Stored size: 511 Bytes

Contents

# frozen_string_literal: false

require 'spec_helper'

describe USPSFlags::Rational do
  it 'renders a simplified fraction as an Array' do
    expect(described_class.new(Rational(4, 3)).to_simplified_a).to eql([1, Rational(1, 3)])
  end

  it 'renders a proper fraction as String' do
    expect(described_class.new(Rational(2, 3)).to_simplified_a).to eql('2/3')
  end

  it 'renders a simplified fraction as a String' do
    expect(described_class.new(Rational(4, 3)).to_simplified_s).to eql('1 1/3')
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
usps_flags-0.6.4 spec/usps_flags/rational_spec.rb
usps_flags-0.6.3 spec/usps_flags/rational_spec.rb
usps_flags-0.6.2 spec/usps_flags/rational_spec.rb
usps_flags-0.6.1 spec/usps_flags/rational_spec.rb
usps_flags-0.6.0 spec/usps_flags/rational_spec.rb
usps_flags-0.5.9 spec/usps_flags/rational_spec.rb
usps_flags-0.5.8 spec/usps_flags/rational_spec.rb
usps_flags-0.5.7 spec/usps_flags/rational_spec.rb
usps_flags-0.5.6 spec/usps_flags/rational_spec.rb
usps_flags-0.5.5 spec/usps_flags/rational_spec.rb
usps_flags-0.5.4 spec/usps_flags/rational_spec.rb
usps_flags-0.5.3 spec/usps_flags/rational_spec.rb
usps_flags-0.5.2 spec/usps_flags/rational_spec.rb
usps_flags-0.5.1 spec/usps_flags/rational_spec.rb