Lint the whole project

This commit is contained in:
Dzmitry Plashchynski
2015-03-13 20:32:27 +02:00
parent 1aa27baca8
commit a9798acb35
23 changed files with 203 additions and 172 deletions

View File

@@ -1,15 +1,16 @@
require "spec_helper"
require 'spec_helper'
require 'crono/cli'
class TestJob
def perform;end
def perform
end
end
describe Crono::CLI do
let(:cli) { Crono::CLI.instance }
describe "#run" do
it "should try to initialize rails with #load_rails and start working loop" do
describe '#run' do
it 'should initialize rails with #load_rails and start working loop' do
expect(cli).to receive(:load_rails)
expect(cli).to receive(:start_working_loop)
expect(cli).to receive(:parse_options)
@@ -18,34 +19,34 @@ describe Crono::CLI do
end
end
describe "#start_working_loop" do
it "should start working loop"
describe '#start_working_loop' do
it 'should start working loop'
end
describe "#parse_options" do
it "should set cronotab" do
cli.send(:parse_options, ["--cronotab", "/tmp/cronotab.rb"])
expect(cli.config.cronotab).to be_eql "/tmp/cronotab.rb"
describe '#parse_options' do
it 'should set cronotab' do
cli.send(:parse_options, ['--cronotab', '/tmp/cronotab.rb'])
expect(cli.config.cronotab).to be_eql '/tmp/cronotab.rb'
end
it "should set logfile" do
cli.send(:parse_options, ["--logfile", "log/crono.log"])
expect(cli.config.logfile).to be_eql "log/crono.log"
it 'should set logfile' do
cli.send(:parse_options, ['--logfile', 'log/crono.log'])
expect(cli.config.logfile).to be_eql 'log/crono.log'
end
it "should set pidfile" do
cli.send(:parse_options, ["--pidfile", "tmp/pids/crono.0.log"])
expect(cli.config.pidfile).to be_eql "tmp/pids/crono.0.log"
it 'should set pidfile' do
cli.send(:parse_options, ['--pidfile', 'tmp/pids/crono.0.log'])
expect(cli.config.pidfile).to be_eql 'tmp/pids/crono.0.log'
end
it "should set daemonize" do
cli.send(:parse_options, ["--daemonize"])
it 'should set daemonize' do
cli.send(:parse_options, ['--daemonize'])
expect(cli.config.daemonize).to be true
end
it "should set environment" do
cli.send(:parse_options, ["--environment", "production"])
expect(cli.config.environment).to be_eql("production")
it 'should set environment' do
cli.send(:parse_options, ['--environment', 'production'])
expect(cli.config.environment).to be_eql('production')
end
end
end