spec/unit/puppet-herald/cli_spec.rb in puppet-herald-0.2.0 vs spec/unit/puppet-herald/cli_spec.rb in puppet-herald-0.8.0
- old
+ new
@@ -1,9 +1,10 @@
require 'spec_helper'
require 'puppet-herald'
require 'puppet-herald/cli'
require 'sinatra/base'
+require 'sinatra/activerecord'
class TestCLI < PuppetHerald::CLI
def test_parse(argv)
self.parse(argv)
end
@@ -12,13 +13,13 @@
context 'With silenced loggers' do
let(:cli) { TestCLI.new }
before :each do
- cli.logger.level = 100
- cli.errlogger.level = 100
- PuppetHerald::database::logger.level = 100
+ PuppetHerald.environment = :test
+ PuppetHerald.logger.level = 100
+ PuppetHerald.errlogger.level = 100
PuppetHerald::database::dbconn = nil
allow(FileUtils).to receive(:touch)
end
describe PuppetHerald::CLI, '.parse' do
@@ -41,10 +42,9 @@
subject { cli.run! argv }
context 'on defaults' do
let(:argv) { [] }
before :each do
- expect(PuppetHerald).to receive(:in_dev?).at_least(:once).and_return(false)
expect(Kernel).to receive(:exit).with(0)
expect(Sinatra::Application).to receive(:run!).and_return :none
dbconn = { :adapter => 'sqlite3', :database => ':memory:' }
expect(PuppetHerald::database).to receive(:spec).at_least(:once).and_return dbconn
require 'stringio' # silence the output
\ No newline at end of file