Refactor tests specs with shared examples
This commit is contained in:
@@ -8,9 +8,7 @@ module Producer::Core
|
||||
let(:content) { 'some_content' }
|
||||
subject(:test) { FileContains.new(env, filepath, content) }
|
||||
|
||||
it 'is a kind of test' do
|
||||
expect(test).to be_a Test
|
||||
end
|
||||
it_behaves_like 'test'
|
||||
|
||||
describe '#verify' do
|
||||
let(:fs) { double 'fs' }
|
||||
|
@@ -7,9 +7,7 @@ module Producer::Core
|
||||
let(:path) { 'some_directory' }
|
||||
subject(:has_dir) { HasDir.new(env, path) }
|
||||
|
||||
it 'is a kind of test' do
|
||||
expect(has_dir).to be_a Test
|
||||
end
|
||||
it_behaves_like 'test'
|
||||
|
||||
describe '#verify', :ssh do
|
||||
before { sftp_story }
|
||||
|
@@ -7,9 +7,7 @@ module Producer::Core
|
||||
let(:variable_name) { :some_variable_name }
|
||||
subject(:has_env) { HasEnv.new(env, variable_name) }
|
||||
|
||||
it 'is a kind of test' do
|
||||
expect(has_env).to be_a Test
|
||||
end
|
||||
it_behaves_like 'test'
|
||||
|
||||
describe '#verify' do
|
||||
let(:environment) { double 'environment' }
|
||||
|
@@ -7,9 +7,7 @@ module Producer::Core
|
||||
let(:filepath) { 'some_file' }
|
||||
subject(:has_file) { HasFile.new(env, filepath) }
|
||||
|
||||
it 'is a kind of test' do
|
||||
expect(has_file).to be_a Test
|
||||
end
|
||||
it_behaves_like 'test'
|
||||
|
||||
describe '#verify', :ssh do
|
||||
before { sftp_story }
|
||||
|
Reference in New Issue
Block a user