Sha256: 6cb9afaef6b7f5f472f68bd440aca4a06ac9602cdd6da8c2ffe7c4781f706c0c

Contents?: true

Size: 701 Bytes

Versions: 19

Compression:

Stored size: 701 Bytes

Contents

require 'spec_helper'

describe Rgentpl::Initializer do
  describe '#build' do
    it 'loads enviroment' do
      expect(Rgentpl.env).to eq TEMPLATE_ENV
    end

    context 'given initializers' do
      let(:initializer) do
        File.expand_path("#{File.dirname(__FILE__)}/../../../../config/initializers/sample.rb")
      end

      before :each do
        file = File.new(initializer, 'w')
        file.write "Rgentpl.configure { |c| c.new_key = 'New value' }"
        file.close

        Rgentpl::Initializer.build
      end

      after do
        File.delete initializer
      end

      it 'loads file' do
        expect(Rgentpl.config.new_key).to eq 'New value'
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
rgentpl-1.2.6 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.2.5 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.2.4.3 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.2.4.2 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.2.4.1 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.2.4 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.2.3 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.2.2 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.2.1 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.2.0 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.0.9 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.0.8 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.0.7 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.0.6 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.0.5 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.0.4 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.0.3 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.0.2 spec/lib/rgentpl/boot/initializer_spec.rb
rgentpl-1.0.1 spec/lib/rgentpl/boot/initializer_spec.rb