Improve Recipe spec:
* Fix coding standards; * Add spec for default assigned filepath; * Add spec for #filepath accessor; * Test object identity in #code spec.
This commit is contained in:
parent
29563f6cc6
commit
22ae12185d
@ -21,14 +21,23 @@ module Producer::Core
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe '#initialize' do
|
describe '#initialize' do
|
||||||
it 'builds a recipe' do
|
it 'assigns nil as a default filepath' do
|
||||||
expect(recipe).to be_a Recipe
|
expect(recipe.filepath).to be nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#code' do
|
describe '#code' do
|
||||||
it 'returns the assigned code' do
|
it 'returns the assigned code' do
|
||||||
expect(recipe.code).to eq code
|
expect(recipe.code).to be code
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe '#filepath' do
|
||||||
|
let(:filepath) { 'some_file_path' }
|
||||||
|
let(:recipe) { Recipe.new(code, filepath) }
|
||||||
|
|
||||||
|
it 'returns the assigned file path' do
|
||||||
|
expect(recipe.filepath).to eq filepath
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user