Sha256: 74a02e61e0e0494fe05dd935f6ce7c8c9ec45aa8610dd509a51ea9d638255440

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

require 'minarai/loaders/recipe_loader'
require 'minarai/recipe'

describe Minarai::Loaders::RecipeLoader do
  subject { loader.load }

  let!(:loader) { described_class.new(*option) }

  describe 'loading recipe and variable ' do
    context 'with recipe file' do
      context 'when valid path received' do
        let(:option) { 'examples/recipe_git.yml' }
        it { is_expected.to be_a Minarai::Recipe }
      end

      context 'when valid path received' do
        let(:option) { 'examples/invalid' }
        it { expect { loader.load }.to raise_error }
      end

      context 'when excpept yml or erb file received' do
        let(:option) { 'examples/recipe.invalid' }
        it { expect { loader.load }.to raise_error }
      end
    end

    context 'with recipe file and variables files' do
      context 'when valid path received' do
        let(:option) do
          ['examples/recipe_erb.yml.erb', { variable_path: 'examples/recipe_variable.yml' }]
        end
        it { is_expected.to be_a Minarai::Recipe }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
minarai-0.0.3 spec/minarai/unit/loaders/recipe_loader_spec.rb