Sha256: 230635f9ce7b01518d65dbaebe80f950b540859d86d9fa1018c927bb03a9bce9

Contents?: true

Size: 499 Bytes

Versions: 5

Compression:

Stored size: 499 Bytes

Contents

require 'spec_helper'
require 'percentable'
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

5 entries across 5 versions & 1 rubygems

Version Path
percentable-1.1.2 spec/lib/percentable/numeric_spec.rb
percentable-1.0.2 spec/lib/percentable/numeric_spec.rb
percentable-1.0.1 spec/lib/percentable/numeric_spec.rb
percentable-1.0.0 spec/lib/percentable/numeric_spec.rb
percentable-0.1.0 spec/lib/percentable/numeric_spec.rb