Sha256: f6a446d2ea10c6d6d79f32bfa2beb90a91fc2c0f2c59888da3d309d4484ecd69

Contents?: true

Size: 632 Bytes

Versions: 4

Compression:

Stored size: 632 Bytes

Contents

# frozen_string_literal: true

require 'dry/logic/predicates'

RSpec.describe Dry::Logic::Predicates do
  describe '#decimal?' do
    let(:predicate_name) { :decimal? }

    context 'when value is a decimal' do
      let(:arguments_list) do
        [[1.2.to_d]]
      end

      it_behaves_like 'a passing predicate'
    end

    context 'with value is not an integer' do
      let(:arguments_list) do
        [
          [''],
          [[]],
          [{}],
          [nil],
          [:symbol],
          [String],
          [1],
          [1.0]
        ]
      end

      it_behaves_like 'a failing predicate'
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dry-logic-1.0.5 spec/unit/predicates/decimal_spec.rb
dry-logic-1.0.4 spec/unit/predicates/decimal_spec.rb
dry-logic-1.0.3 spec/unit/predicates/decimal_spec.rb
dry-logic-1.0.2 spec/unit/predicates/decimal_spec.rb