Sha256: c4f82a649b98e51251a4c8d340216397bbd1e83a9edff39d68d683ce4c0f2f1d

Contents?: true

Size: 1.44 KB

Versions: 15

Compression:

Stored size: 1.44 KB

Contents

describe MetadataJsonLint::VersionRequirement do
  describe '.new' do
    it { expect(described_class.new('')).to be_a(MetadataJsonLint::VersionRequirement) }
    it { expect(described_class.new('>= 1.0')).to be_a(MetadataJsonLint::VersionRequirement) }
    it { expect { described_class.new('## 1.0') }.to raise_error(ArgumentError) }
  end

  describe '#mixed_syntax?' do
    it { expect(described_class.new('>= 1.0.0').mixed_syntax?).to be false }
    it { expect(described_class.new('1.0.x').mixed_syntax?).to be false }
    it { expect(described_class.new('>= 1.0.0 < 2.0').mixed_syntax?).to be false }
    it { expect(described_class.new('< 2.0').mixed_syntax?).to be false }

    it { expect(described_class.new('>= 1.0.x').mixed_syntax?).to be true }
    it { expect(described_class.new('>= 1.0.*').mixed_syntax?).to be true }
    it { expect(described_class.new('>= 1.x').mixed_syntax?).to be true }
    it { expect(described_class.new('>= 1.x.x').mixed_syntax?).to be true }
    it { expect(described_class.new('>= 1.*').mixed_syntax?).to be true }
    it { expect(described_class.new('>= 1.0.0 < 2.x').mixed_syntax?).to be true }
    it { expect(described_class.new('<2.x').mixed_syntax?).to be true }
  end

  describe '#open_ended?' do
    it { expect(described_class.new('>= 1.0 < 2.0').open_ended?).to be false }
    it { expect(described_class.new('>= 1.0').open_ended?).to be true }
    it { expect(described_class.new('').open_ended?).to be true }
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
metadata-json-lint-4.1.0 spec/metadata_json_lint/version_requirement_spec.rb
metadata-json-lint-4.0.0 spec/version_requirement_spec.rb
metadata-json-lint-3.0.3 spec/version_requirement_spec.rb
metadata-json-lint-3.0.2 spec/version_requirement_spec.rb
metadata-json-lint-3.0.1 spec/version_requirement_spec.rb
metadata-json-lint-3.0.0 spec/version_requirement_spec.rb
metadata-json-lint-2.4.0 spec/version_requirement_spec.rb
metadata-json-lint-2.3.0 spec/version_requirement_spec.rb
metadata-json-lint-2.2.0 spec/version_requirement_spec.rb
metadata-json-lint-2.1.0 spec/version_requirement_spec.rb
metadata-json-lint-2.0.2 spec/version_requirement_spec.rb
metadata-json-lint-2.0.1 spec/version_requirement_spec.rb
metadata-json-lint-2.0.0 spec/version_requirement_spec.rb
metadata-json-lint-1.2.2 spec/version_requirement_spec.rb
metadata-json-lint-1.2.1 spec/version_requirement_spec.rb