Sha256: c5587fd2259b51ed935f420823690e4a47e420dea0015fd32d76627318b6fa2f

Contents?: true

Size: 883 Bytes

Versions: 1

Compression:

Stored size: 883 Bytes

Contents

require 'spec_helper'

describe Chef::Sugar::Rackconnect do

  fake_node = {
    'rackspace' => {}
  }

  let(:node)  { fake_node }

  context 'when the ohai plugin is not found' do
    it '#rackconnected? raises an error' do
      expect{described_class.rackconnected?(node)}.to raise_error(RuntimeError)
    end
  end

  context 'when rackconnected' do
    before do
      node['rackspace'] = {
        'rackconnect' => {
          'enabled' => true
        }
      }
    end
    it '#rackconnected? returns true' do
      expect(described_class.rackconnected?(node)).to eq(true)
    end
  end

  context 'when not rackconnected' do
    before do
      node['rackspace'] = {
        'rackconnect' => {
          'enabled' => false
        }
      }
    end
    it '#rackconnected? returns false' do
      expect(described_class.rackconnected?(node)).to eq(false)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chef-sugar-rackspace-0.2.0 spec/unit/chef/sugar/rackspace/rackconnect_spec.rb