Sha256: 7d07948c32fac3810a7c8f891606aea74f2807172785a9e41d37cc5748c82496

Contents?: true

Size: 586 Bytes

Versions: 6

Compression:

Stored size: 586 Bytes

Contents

require 'dry/validation/predicates'

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

    context 'when value is a string' do
      let(:arguments_list) do
        [
          [''],
          ['John']
        ]
      end

      it_behaves_like 'a passing predicate'
    end

    context 'with value is not a string' do
      let(:arguments_list) do
        [
          [[]],
          [{}],
          [nil],
          [:symbol],
          [String]
        ]
      end

      it_behaves_like 'a failing predicate'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dry-validation-0.4.1 spec/unit/predicates/str_spec.rb
dry-validation-0.4.0 spec/unit/predicates/str_spec.rb
dry-validation-0.3.1 spec/unit/predicates/str_spec.rb
dry-validation-0.3.0 spec/unit/predicates/str_spec.rb
dry-validation-0.2.0 spec/unit/predicates/str_spec.rb
dry-validation-0.1.0 spec/unit/predicates/str_spec.rb