Sha256: 341505e9dfc4b043244737081bff60472edba4f66d56bb1e9538ad3312c961e9
Contents?: true
Size: 1.46 KB
Versions: 1
Compression:
Stored size: 1.46 KB
Contents
require 'vagrant-openstack-illuin-provider/spec_helper' describe VagrantPlugins::Openstack::VersionChecker do let(:version) do double('version') end before :each do @checker = VersionChecker.instance @checker.status = nil Gem.should_receive(:latest_spec_for) .with('vagrant-openstack-illuin-provider') .and_return(OpenStruct.new.tap { |v| v.version = version }) end describe 'check' do it { assert_version_is :latest, '1.2.3', '1.2.3' } it { assert_version_is :latest, '999.999.999', '999.999.999' } it { assert_version_is :unstable, '9999.999.999', '9999.999.999' } it { assert_version_is :unstable, '999.9999.999', '999.9999.999' } it { assert_version_is :unstable, '999.999.9999', '999.999.9999' } it { assert_version_is :unstable, '1.2', '1.2' } it { assert_version_is :outdated, '1.2.3', '1.2.2' } it { assert_version_is :outdated, '1.8.999', '1.8.998' } it { assert_version_is :outdated, '1.9.0', '1.8.999' } it { assert_version_is :outdated, '2.0.0', '1.999.999' } end private def assert_version_is(expected_status, latest, current) stub_const('VagrantPlugins::Openstack::VERSION', current) version.stub(:version) { latest } @checker.stub(:print) expect(@checker).to receive(:print) unless expected_status == :latest @checker.check expect(@checker.status).to eq(expected_status) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vagrant-openstack-illuin-provider-0.12.0 | spec/vagrant-openstack-illuin-provider/version_checker_spec.rb |