serverspec 0.5.5 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -185,6 +185,8 @@ module Serverspec
185
185
  'Solaris'
186
186
  elsif run_command('uname -s')[:stdout] =~ /Darwin/i
187
187
  'Darwin'
188
+ else
189
+ 'Base'
188
190
  end
189
191
  end
190
192
 
@@ -2,7 +2,7 @@ module Serverspec
2
2
  module Helper
3
3
  module DetectOS
4
4
  def commands
5
- os = RSpec.configuration.os || 'Base'
5
+ os = backend(Serverspec::Commands::Base).check_os
6
6
  self.class.const_get('Serverspec').const_get('Commands').const_get(os).new
7
7
  end
8
8
  end
@@ -2,6 +2,9 @@ module Serverspec
2
2
  module Helper
3
3
  module Exec
4
4
  def backend(commands_object=nil)
5
+ if commands_object.nil? && ! respond_to?(:commands)
6
+ commands_object = Serverspec::Commands::Base.new
7
+ end
5
8
  instance = Serverspec::Backend::Exec.instance
6
9
  instance.set_commands(commands_object || commands)
7
10
  instance
@@ -2,6 +2,9 @@ module Serverspec
2
2
  module Helper
3
3
  module Ssh
4
4
  def backend(commands_object=nil)
5
+ if ! respond_to?(:commands)
6
+ commands_object = Serverspec::Commands::Base.new
7
+ end
5
8
  instance = Serverspec::Backend::Ssh.instance
6
9
  instance.set_commands(commands_object || commands)
7
10
  instance
@@ -124,7 +124,6 @@ EOF
124
124
  user = options[:user] || Etc.getlogin
125
125
  ### include vagrant conf ###
126
126
  c.ssh = Net::SSH.start(c.host, user, options)
127
- c.os = backend.check_os
128
127
  end
129
128
  end")
130
129
  if @vagrant
@@ -149,7 +148,6 @@ EOF
149
148
  end
150
149
  when 'Exec'
151
150
  content.gsub!(/### include backend conf ###/, "c.before :all do
152
- c.os = backend.check_os
153
151
  end")
154
152
  when 'Puppet'
155
153
  content.gsub!(/### include requirements ###/, "require 'puppet'\nrequire 'serverspec/backend/puppet'
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
@@ -1,7 +1,5 @@
1
1
  require 'spec_helper'
2
- require 'serverspec/helper/base'
3
2
 
4
- include Serverspec::Helper::Base
5
3
  include Serverspec::Helper::Attributes
6
4
 
7
5
  describe 'Attributes Helper' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: