Skip to content
This repository was archived by the owner on Sep 24, 2019. It is now read-only.

Commit 3da02ac

Browse files
author
Eric Thompson
committed
(QA-3110) spike: rototiller create integration suite
* implement an integration test helper set * this creates a helper that can run a single task in rspec * we could create another helper for rake -T and rake -D, etc, maybe * or it might make sense to just keep testing that stuff in acceptance * this doesn't work * it appears to not run the commands, not clear why [skip ci]
1 parent 0b8bb21 commit 3da02ac

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
require_relative 'integration_helper'
2+
3+
describe RototillerTestTask do
4+
it 'can add one argument' do
5+
# TODO: create helper to create randomized task names
6+
# TODO: abstract this Proc.new crap
7+
task_name = 'abstract_me_to_randomness'
8+
block = Proc.new { |t| t.add_command({:name => 'echo', :add_argument => {:name => "#{task_name}"}}) }
9+
expect{ described_class.new(task_name, &block) }.to output(task_name).to_stdout
10+
end
11+
end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
require 'rototiller'
2+
3+
# tools for running a rototiller_task on localhost
4+
# WARNING: this WILL run tasks ON your system if you tell it to.
5+
class RototillerTestTask
6+
7+
def initialize(*args, &block)
8+
task = Rototiller::Task::RototillerTask.define_task(*args, &block)
9+
task.send('run_task')
10+
end
11+
12+
end

0 commit comments

Comments
 (0)