Sha256: bda77be5958f70bd8d5e8e0e057394711d9f480d196e6eada29048fd9b422a6d

Contents?: true

Size: 1.17 KB

Versions: 8

Compression:

Stored size: 1.17 KB

Contents

$:.unshift File.expand_path('../../lib', __FILE__)
require 'chef'
require 'chef/knife'
require 'ironfan'
require 'fog'
Fog.mock!
Fog::Mock.delay = 0

require 'gorillib/pathname'

Pathname.register_paths(
  code:        File.expand_path('../..', __FILE__),
  fixtures:    [:code, 'spec', 'fixtures'],
  )

RSpec.configure do |cfg|
  def ironfan_go!
    k = Chef::Knife.new
    k.config[:config_file] = Pathname.path_to(:fixtures, 'knife/knife.rb')
    k.configure_chef
    Chef::Config.instance_eval do
      knife.merge!({
          :aws_access_key_id => 'access_key',
          :aws_secret_access_key => 'secret',
        })
      cluster_path Pathname.path_to(:fixtures).to_s
    end

    require 'ironfan'

    Ironfan.ui          = Chef::Knife::UI.new(STDOUT, STDERR, STDIN, {})
    Ironfan.chef_config = k.config
    Ironfan.cluster_path
  end
end

require 'chef_zero/server'
server = ChefZero::Server.new(port: 4000)
server.start_background

def uncreate_plugin(plugin_class, target_class)
  target_class.registry.clear
  plugin_class.instance_eval{ remove_const :BazBif }
end

class Foo
end

class MyPlugin
  include Ironfan::Plugin::Base; register_with Foo

  def self.plugin_hook(*_) end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ironfan-5.0.11 spec/spec_helper.rb
ironfan-5.0.8 spec/spec_helper.rb
ironfan-5.0.5 spec/spec_helper.rb
ironfan-5.0.4 spec/spec_helper.rb
ironfan-5.0.3 spec/spec_helper.rb
ironfan-5.0.2 spec/spec_helper.rb
ironfan-5.0.1 spec/spec_helper.rb
ironfan-5.0.0 spec/spec_helper.rb