Sha256: 5c57c85c1e8e1aa880422e9a246d308b69e8b765b490657441a7e4319028acc6

Contents?: true

Size: 1.18 KB

Versions: 19

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'

describe Jack::VersionChecker do
  let(:checker) { Jack::VersionChecker.new }

  describe "version checker" do
    it "should exit if version is less than required version" do
      expect(checker).to receive(:get_version).and_return("EB CLI 3.0.0 (Python 2.7.6)")
      expect(checker).to receive(:leave).at_least(:once)
      checker.run
    end

    it "should not exit if version matches required version" do
      expect(checker).to receive(:get_version).and_return("EB CLI 3.1.2 (Python 2.7.6)")
      allow(checker).to receive(:leave).and_return(true) # need to stub in order to use to_nav have_received
      expect(checker).to_not have_received(:leave)
      checker.run
    end

    it "should not exit if version is great than required version" do
      expect(checker).to receive(:get_version).and_return("EB CLI 3.2.0 (Python 2.7.6)")
      allow(checker).to receive(:leave).and_return(true) # need to stub in order to use to_nav have_received
      expect(checker).to_not have_received(:leave)
      checker.run
    end

    it "parse version" do
      version = checker.parse_version("EB CLI 3.2.0 (Python 2.7.6)")
      expect(version).to eq [3,2,0]
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
jack-eb-1.0.1 spec/lib/verison_checker_spec.rb
jack-eb-1.0.0 spec/lib/verison_checker_spec.rb
jack-eb-0.3.0 spec/lib/verison_checker_spec.rb
jack-eb-0.2.0 spec/lib/verison_checker_spec.rb
jack-eb-0.1.6 spec/lib/verison_checker_spec.rb
jack-eb-0.1.5 spec/lib/verison_checker_spec.rb
jack-eb-0.1.4 spec/lib/verison_checker_spec.rb
jack-eb-0.1.3 spec/lib/verison_checker_spec.rb
jack-eb-0.1.2 spec/lib/verison_checker_spec.rb
jack-eb-0.1.1 spec/lib/verison_checker_spec.rb
jack-eb-0.1.0 spec/lib/verison_checker_spec.rb
jack-eb-0.0.9 spec/lib/verison_checker_spec.rb
jack-eb-0.0.8 spec/lib/verison_checker_spec.rb
jack-eb-0.0.7 spec/lib/verison_checker_spec.rb
jack-eb-0.0.6 spec/lib/verison_checker_spec.rb
jack-eb-0.0.4 spec/lib/verison_checker_spec.rb
jack-eb-0.0.3 spec/lib/verison_checker_spec.rb
jack-eb-0.0.2 spec/lib/verison_checker_spec.rb
jack-eb-0.0.1 spec/lib/verison_checker_spec.rb