Skip to content

Commit c277c6d

Browse files
committed
Spec: replace duplicate constant w/ assertion
1 parent 3e783fe commit c277c6d

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

spec/integration/build/aws_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888

8989
stemcell_manifest = YAML.load(read_from_tgz(stemcell, 'stemcell.MF'))
9090
expect(stemcell_manifest['version']).to eq('1200.3.1-build.2')
91-
expect(stemcell_manifest['sha1']).to eq(EMPTY_FILE_SHA)
91+
expect(stemcell_manifest['sha1']).to eq(Stemcell::Manifest::EMPTY_FILE_SHA)
9292
expect(stemcell_manifest['operating_system']).to eq(@os_version)
9393
expect(stemcell_manifest['api_version']).to eq(3)
9494
expect(stemcell_manifest['stemcell_formats']).to eq(['aws-light'])
@@ -263,7 +263,7 @@
263263
stemcell_manifest = YAML.load(read_from_tgz(stemcell, 'stemcell.MF'))
264264
expect(stemcell_manifest['version']).to eq('1200.3')
265265
expect(stemcell_manifest['api_version']).to eq(2)
266-
expect(stemcell_manifest['sha1']).to eq(EMPTY_FILE_SHA)
266+
expect(stemcell_manifest['sha1']).to eq(Stemcell::Manifest::EMPTY_FILE_SHA)
267267
expect(stemcell_manifest['operating_system']).to eq(@os_version)
268268
expect(stemcell_manifest['cloud_properties']['infrastructure']).to eq('aws')
269269
expect(stemcell_manifest['cloud_properties']['encrypted']).to eq(false)

spec/integration/build/azure_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
expect(stemcell_manifest['api_version']).to eq(3)
8585

86-
expect(stemcell_manifest['sha1']).to eq(EMPTY_FILE_SHA)
86+
expect(stemcell_manifest['sha1']).to eq(Stemcell::Manifest::EMPTY_FILE_SHA)
8787

8888
expect(stemcell_manifest['operating_system']).to eq(os_version)
8989

spec/integration/build/gcp_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
stemcell_manifest = YAML.load(read_from_tgz(stemcell, 'stemcell.MF'))
6565
expect(stemcell_manifest['version']).to eq('1200.3.1-build.2')
6666
expect(stemcell_manifest['api_version']).to eq(3)
67-
expect(stemcell_manifest['sha1']).to eq(EMPTY_FILE_SHA)
67+
expect(stemcell_manifest['sha1']).to eq(Stemcell::Manifest::EMPTY_FILE_SHA)
6868
expect(stemcell_manifest['operating_system']).to eq(os_version)
6969
expect(stemcell_manifest['stemcell_formats']).to eq(['google-light'])
7070
expect(stemcell_manifest['cloud_properties']['infrastructure']).to eq('google')

spec/spec_helper.rb

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
require 'simplecov'
22
SimpleCov.start
3-
EMPTY_FILE_SHA = 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
3+
44
require 'zip'
55
require 'timecop'
66

7-
# Mock web requests
87
require 'webmock/rspec'
98
WebMock.disable_net_connect!(allow_localhost: true)
109

@@ -17,19 +16,9 @@
1716
mocks.verify_partial_doubles = true
1817
end
1918

20-
config.shared_context_metadata_behavior = :apply_to_host_groups
21-
22-
config.filter_run_when_matching :focus
23-
24-
config.example_status_persistence_file_path = "spec/examples.txt"
25-
2619
if config.files_to_run.one?
2720
config.default_formatter = 'doc'
2821
end
29-
30-
config.order = :random
31-
32-
Kernel.srand config.seed
3322
end
3423

3524
def tgz_extract(file_path, out_dir)

spec/stemcell/manifest_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
require 'stemcell/manifest'
22

33
describe Stemcell::Manifest do
4+
describe 'EMPTY_FILE_SHA' do
5+
let(:expected_empty_sha_value) { 'da39a3ee5e6b4b0d3255bfef95601890afd80709' }
6+
7+
it 'has the expected value' do
8+
expect(Stemcell::Manifest::EMPTY_FILE_SHA).to eq(expected_empty_sha_value)
9+
end
10+
end
11+
412
describe 'Base' do
513
describe 'dump' do
614
it 'returns a valid stemcell manifest yaml string' do

0 commit comments

Comments
 (0)