spec/rake/funnel/support/version_info_spec.rb in rake-funnel-0.18.0 vs spec/rake/funnel/support/version_info_spec.rb in rake-funnel-0.19.0
- old
+ new
@@ -173,11 +173,11 @@
}
},
{
context: {
version: '1.2',
- metadata: { }
+ metadata: {}
},
expected: {
assembly_version: '1.2.0.0',
assembly_file_version: '1.2.0.0',
assembly_informational_version: '1.2.0'
@@ -257,11 +257,11 @@
assembly_file_version: '1.0.0.456',
assembly_informational_version: '1.0.0-123+build.456.sha.789'
}
}
].each do |spec|
- context "version #{spec[:context][:version] || 'none'}, build number #{spec[:context].fetch(:metadata, {})[:build] || 'none'}, SHA #{spec[:context].fetch(:metadata, {})[:sha] || 'none'}" do
+ context "version #{spec[:context][:version] || 'none'}, build number #{spec[:context].fetch(:metadata, {})[:build] || 'none'}, SHA #{spec[:context].fetch(:metadata, {})[:sha] || 'none'}" do # rubocop:disable Metrics/LineLength
let(:parsed) { described_class.parse(spec[:context]) }
it "should generate assembly version #{spec[:expected][:assembly_version]}" do
expect(parsed.assembly_version).to eq(spec[:expected][:assembly_version])
end
@@ -302,19 +302,21 @@
end
end
describe '#read_version_from' do
let(:file) { 'file with version info' }
- let(:contents) { <<-EOF
+ let(:contents) do
+ # rubocop:disable Style/IndentHeredoc
+ <<-EOF
first line with expected version number
other crap
- EOF
- }
+ EOF
+ # rubocop:enable Style/IndentHeredoc
+ end
it 'should read the first line with leading and trailing whitespace removed' do
Dir.mktmpdir do |tmp|
Dir.chdir(tmp) do
-
File.write(file, contents)
expect(described_class.read_version_from(file)).to eq('first line with expected version number')
end
end
end