diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/cli_spec.rb | 11 | ||||
-rw-r--r-- | spec/input/ssh_spec.rb | 1 | ||||
-rw-r--r-- | spec/node_spec.rb | 3 | ||||
-rw-r--r-- | spec/nodes_spec.rb | 4 |
4 files changed, 10 insertions, 9 deletions
diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb index 0a6c91b..eb9872e 100644 --- a/spec/cli_spec.rb +++ b/spec/cli_spec.rb @@ -2,23 +2,20 @@ require 'spec_helper' require 'oxidized/cli' describe Oxidized::CLI do - let(:asetus) { mock() } - - after { ARGV.replace @original } before { @original = ARGV } + after { ARGV.replace @original } %w[-v --version].each do |option| describe option do - before { ARGV.replace [option] } + before { ARGV.replace([option]) } it 'prints the version and exits' do Oxidized::Config.expects(:load) Oxidized.expects(:setup_logger) + File.expects(:expand_path) Kernel.expects(:exit) - proc { - Oxidized::CLI.new - }.must_output "#{Oxidized::VERSION}\n" + assert_output("#{Oxidized::VERSION}\n") { Oxidized::CLI.new } end end end diff --git a/spec/input/ssh_spec.rb b/spec/input/ssh_spec.rb index c4210f2..2550d5c 100644 --- a/spec/input/ssh_spec.rb +++ b/spec/input/ssh_spec.rb @@ -4,6 +4,7 @@ require 'oxidized/input/ssh' describe Oxidized::SSH do before(:each) do Oxidized.asetus = Asetus.new + Oxidized.setup_logger Oxidized::Node.any_instance.stubs(:resolve_input) Oxidized::Node.any_instance.stubs(:resolve_output) @node = Oxidized::Node.new(name: 'example.com', diff --git a/spec/node_spec.rb b/spec/node_spec.rb index 21c6e34..1c38558 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -2,7 +2,8 @@ require 'spec_helper' describe Oxidized::Node do before(:each) do - Oxidized.stubs(:asetus).returns(Asetus.new) + Oxidized.asetus = Asetus.new + Oxidized.setup_logger Oxidized::Node.any_instance.stubs(:resolve_output) @node = Oxidized::Node.new(name: 'example.com', diff --git a/spec/nodes_spec.rb b/spec/nodes_spec.rb index 5f2ef95..4560bdb 100644 --- a/spec/nodes_spec.rb +++ b/spec/nodes_spec.rb @@ -3,7 +3,9 @@ require 'spec_helper' describe Oxidized::Nodes do before(:each) do Resolv.any_instance.stubs(:getaddress) - Oxidized.stubs(:asetus).returns(Asetus.new) + Oxidized.asetus = Asetus.new + Oxidized.setup_logger + opts = { input: 'ssh', output: 'git', |