Refactor tests specs with shared examples

This commit is contained in:
Thibault Jouan
2014-02-10 17:33:48 +00:00
parent 4624a81100
commit 91637ca631
6 changed files with 86 additions and 89 deletions

View File

@@ -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' }

View File

@@ -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 }

View File

@@ -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' }

View File

@@ -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 }