-
Notifications
You must be signed in to change notification settings - Fork 3
How do I...?
Beth Skurrie edited this page May 27, 2015
·
3 revisions
describe "when there are no triggers" "$(
stub run_loader
it 'does not run' "$(
run_if_new_data
expect $(stub_called_times run_loader) to_be '0'
)"
)"
describe "when there are triggers" "$(
it 'runs the loader with the names of the datasets to load' "$(
stub run_loader
create_triggers_database
add_trigger 'bake-sale'
add_trigger 'lemonade-stand'
run_if_new_data
expect $(stub_called_with_times run_loader bake-sale lemonade-stand) to_be '1'
)"
)"
This is a bit of a dirty hack, but it gets the job done.
describe "when there are triggers" "$(
it 'runs the loader with the names of the datasets to load' "$(
rm -rf tmp/verify-run-loader-args
stub_and_eval run_loader 'echo $@ > tmp/verify-run-loader-args'
create_triggers_database
add_trigger 'bake-sale'
add_trigger 'lemonade-stand'
expect "$(cat tmp/verify-run-loader-args)" to_be "bake-sale lemonade-stand"
)"
)"