Sha256: 9f2f3c81069dd7bfd9e9c9202aad545076139c228405f698d34570aba440374a

Contents?: true

Size: 1013 Bytes

Versions: 9

Compression:

Stored size: 1013 Bytes

Contents

require 'spec_helper'
require 'rspec/support/version_checker'

module RSpec::Support
  describe VersionChecker do
    def check_version(*args)
      VersionChecker.new(*args).check_version!
    end

    it 'raises an error if the major version is too low' do
      expect { check_version('some_gem', '0.7.3', '1.0.0') }.to raise_error(LibraryVersionTooLowError)
    end

    it 'raises an error if the minor version is too low' do
      expect { check_version('some_gem', '1.0.99', '1.1.3') }.to raise_error(LibraryVersionTooLowError)
    end

    it 'raises an error if the patch version is too low' do
      expect { check_version('some_gem', '1.0.8', '1.0.10') }.to raise_error(LibraryVersionTooLowError)
    end

    it 'does not raise an error when the version is above the min version' do
      check_version('some_gem', '2.0.0', '1.0.0')
      check_version('some_gem', '1.2.0', '1.1.0')
      check_version('some_gem', '1.1.3', '1.1.1')
      check_version('some_gem', '1.1.3', '1.1.3')
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
opal-rspec-0.6.2 rspec-support/spec/rspec/support/version_checker_spec.rb
opal-rspec-0.6.1 rspec-support/spec/rspec/support/version_checker_spec.rb
opal-rspec-0.6.0 rspec-support/spec/rspec/support/version_checker_spec.rb
opal-rspec-0.6.0.beta1 rspec-support/spec/rspec/support/version_checker_spec.rb
opal-connect-rspec-0.5.0 rspec-support/spec/rspec/support/version_checker_spec.rb
opal-rspec-0.5.0 rspec-support/spec/rspec/support/version_checker_spec.rb
opal-rspec-0.5.0.beta3 rspec-support/spec/rspec/support/version_checker_spec.rb
opal-rspec-0.5.0.beta2 rspec-support/spec/rspec/support/version_checker_spec.rb
opal-rspec-0.5.0.beta1 rspec-support/spec/rspec/support/version_checker_spec.rb