# frozen_string_literal: true require 'git-version-bump' require 'rubygems' RSpec.describe GVB do it "has a version number" do expect(GVB.version).not_to be nil end %w(major_version minor_version patch_version).each do |method_name| it "has the method #{method_name}" do expect(GVB.methods.include?(method_name.to_sym)).to eq(true) end end end RSpec.describe DeployRubygem do it "has a version number" do expect(DeployRubygem::VERSION).not_to be nil end %w(main deploy_jimbodragon change_to_directory deploy_rubygem_path chefrepo_path).each do |method_name| it "has the method #{method_name}" do expect(DeployRubygem.methods.include?(method_name.to_sym)).to eq(true) end end it "has pre latest version publish" do expect(`gem list -r deploy_rubygem`).to include("deploy_rubygem (#{Gem::Version.new("#{GVB.major_version}.#{GVB.minor_version - 1}.1")})") end end RSpec.describe 'Publish itself' do it "publish itself" do expect(DeployRubygem.main).not_to be nil end it "has pre latest version publish" do expect(`gem list -r deploy_rubygem`).to include("deploy_rubygem (#{Gem::Version.new("#{GVB.major_version}.#{GVB.minor_version - 1}.1")})") end it "has latest version publish" do expect(`gem list -r deploy_rubygem`).not_to include("deploy_rubygem (#{GVB.version}})") end end