Skip to content

Commit

Permalink
add test for task_runner
Browse files Browse the repository at this point in the history
  • Loading branch information
sonots committed May 24, 2014
1 parent befb5bc commit af16663
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')

ENV['RACK_ENV'] = 'test'
ENV['JOB_DIR'] = 'spec/tmp'

# NOTE: DATABASE_URL in .env must be commented out
require 'fluentd_server'
Expand Down
27 changes: 27 additions & 0 deletions spec/task_runner_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require_relative 'spec_helper'
require 'fluentd_server/task_runner'
require 'fluentd_server/model'

describe 'TaskRunner' do
let(:task) { Task.create }
before { task.stub(:delay).and_return { task } }
after { Task.delete_all }

context '.serf_path' do
it { expect(File.executable?(Task.serf_path)).to be_true }
end

# ToDo: Test whether the serf command is executed correctly
context '#restart' do
it { expect { task.restart }.not_to raise_error }
end

context '#status' do
it { expect { task.status }.not_to raise_error }
end

context '#configrest' do
it { expect { task.configtest }.not_to raise_error }
end
end

0 comments on commit af16663

Please sign in to comment.