Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ gem "hiera", *location_for(ENV['HIERA_LOCATION'] || ['>= 2.0', '< 4'])
gem "rake", "10.1.1", :require => false

group(:development, :test) do
# RSpec 3.5.z is not compatible with parallel:spec. The version pin of '< 3.5.0', be removed once PUP-6466 is resolved
gem "rspec", "~> 3.1", "< 3.5.0", :require => false
gem "rspec", "~> 3.1", :require => false
gem "rspec-its", "~> 1.1", :require => false
gem "rspec-collection_matchers", "~> 1.1", :require => false
gem "rspec-legacy_formatters", "~> 1.0", :require => false
Expand Down
15 changes: 15 additions & 0 deletions spec/unit/version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@

describe "Puppet.version Public API" do
before :each do
@current_ver = Puppet.version
Puppet.instance_eval do
if @puppet_version
@puppet_version = nil
end
end
end

after :each do
Puppet.version = @current_ver
end

context "without a VERSION file" do
before :each do
Puppet.stubs(:read_version_file).returns(nil)
Expand Down Expand Up @@ -39,4 +44,14 @@
expect(Puppet.version).to eq('1.2.3')
end
end

context "Using version setter" do
it "does not read VERSION file if using set version" do
Puppet.expects(:read_version_file).never
Puppet.version = '1.2.3'
expect(Puppet.version).to eq('1.2.3')
end
end
end


2 changes: 1 addition & 1 deletion util/rspec_grouper
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module Parallel

# Populate a map of spec file => example count, sorted ascending by count
# NOTE: this uses a private API of RSpec and is may break if the gem is updated
@files = ::RSpec::Core::ExampleGroup.children.inject({}) do |files, group|
@files = ::RSpec.world.example_groups.inject({}) do |files, group|
file = group.metadata[:example_group_block].source_location[0]
count = count_examples(group)
files[file] = (files[file] || 0) + count
Expand Down