spec/unit/packagers/deb_spec.rb in omnibus-4.0.0.rc.2 vs spec/unit/packagers/deb_spec.rb in omnibus-4.0.0

- old
+ new

@@ -258,20 +258,20 @@ context 'when the project name has invalid characters' do before { project.name("Pro$ject123.for-realz_2") } it 'returns the value while logging a message' do output = capture_logging do - expect(subject.safe_base_package_name).to eq('Pro-ject123.for-realz-2') + expect(subject.safe_base_package_name).to eq('pro-ject123.for-realz-2') end - expect(output).to include("The `name' compontent of Debian package names can only include") + expect(output).to include("The `name' component of Debian package names can only include") end end end describe '#safe_build_iteration' do - it 'returns the build iternation' do + it 'returns the build iteration' do expect(subject.safe_build_iteration).to eq(project.build_iteration) end end describe '#safe_version' do @@ -280,18 +280,30 @@ expect(subject.safe_version).to eq('1.2.3') expect(subject).to_not receive(:log) end end + context 'when the project build_version has dashes' do + before { project.build_version('1.2-rc.1') } + + it 'returns the value while logging a message' do + output = capture_logging do + expect(subject.safe_version).to eq('1.2~rc.1') + end + + expect(output).to include("Dashes hold special significance in the Debian package versions.") + end + end + context 'when the project build_version has invalid characters' do - before { project.build_version("1.2$alpha.##__2") } + before { project.build_version("1.2$alpha.~##__2") } it 'returns the value while logging a message' do output = capture_logging do - expect(subject.safe_version).to eq('1.2-alpha.-2') + expect(subject.safe_version).to eq('1.2_alpha.~_2') end - expect(output).to include("The `version' compontent of Debian package names can only include") + expect(output).to include("The `version' component of Debian package names can only include") end end end describe '#safe_architecture' do