Sha256: a9347ea1f8b205a4c2bc7fd25778eaa84dede4d50dae4526a52e76d66c7bd2d2

Contents?: true

Size: 485 Bytes

Versions: 1

Compression:

Stored size: 485 Bytes

Contents

require 'percentable/numeric'
require 'bigdecimal'

describe Numeric do
  [1, 1.0, BigDecimal.new(1, 10)].each do |numeric|
    subject { numeric }

    context numeric.class.name do
      describe '#to_percent' do
        it 'should respond to it' do
          expect(subject).to respond_to :to_percent
        end

        it 'should return the value as percent' do
          expect(subject.to_percent).to eq Percentable::Percent.new(subject)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
percentable-0.0.1 spec/lib/percentable/numeric_spec.rb