Declare macro in tasks

This commit is contained in:
Thibault Jouan
2014-09-25 00:27:46 +00:00
parent 8ce8c2f054
commit 3dc414f188
3 changed files with 22 additions and 3 deletions

View File

@@ -49,10 +49,15 @@ module Producer::Core
describe '#macro' do
it 'defines the new recipe keyword' do
recipe.macro :hello
recipe.macro(:hello) { }
expect(recipe).to respond_to(:hello)
end
it 'defines the new task keyword' do
recipe.macro(:hello) { }
expect { recipe.task(:some_task) { hello } }.not_to raise_error
end
context 'when a defined macro is called' do
before { recipe.macro(:hello) { :some_macro_code } }