Sha256: cb810726bc61433f8706675c35f188976c28aaf6be8c9f9eeff4c9f3fb3c94fe

Contents?: true

Size: 747 Bytes

Versions: 11

Compression:

Stored size: 747 Bytes

Contents

# frozen_string_literal: true

class FakeClass
  include FinAppsCore::Utils::Validatable
end

RSpec.describe FinAppsCore::Utils::Validatable do
  describe '#not_blank' do
    context 'with null values' do
      it 'raises FinAppsCore::MissingArgumentsError' do
        expect { FakeClass.new.not_blank(nil) }
          .to raise_error(FinAppsCore::MissingArgumentsError)
      end

      it 'describes the argument name when provided' do
        expect { FakeClass.new.not_blank(nil, :name) }
          .to raise_error(FinAppsCore::MissingArgumentsError, ': name')
      end
    end

    context 'with non null values' do
      it 'does not raise' do
        expect { FakeClass.new.not_blank(true) }.not_to raise_error
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
finapps_core-6.0.2 spec/utils/validatable_spec.rb
finapps_core-6.0.1 spec/utils/validatable_spec.rb
finapps_core-6.0.0 spec/utils/validatable_spec.rb
finapps_core-5.0.16 spec/utils/validatable_spec.rb
finapps_core-5.0.15 spec/utils/validatable_spec.rb
finapps_core-5.0.14 spec/utils/validatable_spec.rb
finapps_core-5.0.13 spec/utils/validatable_spec.rb
finapps_core-5.0.11 spec/utils/validatable_spec.rb
finapps_core-5.0.10 spec/utils/validatable_spec.rb
finapps_core-5.0.9 spec/utils/validatable_spec.rb
finapps_core-5.0.8 spec/utils/validatable_spec.rb