Sha256: 2259b47cc17af2fb30606876f875fb09df90ffba0e7eed1bfbe57a01ce102c6c

Contents?: true

Size: 712 Bytes

Versions: 3

Compression:

Stored size: 712 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe Rubygen do
  context '#execute' do
    it 'generates output based on hash with symbol keys' do
      template = <<-EOS.strip_heredoc
      <%= lookup('name') %>
      EOS

      data = {
        name: 'karl'
      }

      generator = Rubygen.new
      result = generator.run(template, data)

      expect(result).to include('karl')
    end

    it 'generates output based on hash with string keys' do
      template = <<-EOS.strip_heredoc
      <%= lookup('name') %>
      EOS

      data = {
        'name' => 'karl'
      }

      generator = Rubygen.new
      result = generator.run(template, data)

      expect(result).to include('karl')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
filegen-0.4.3 spec/ruby_gen_spec.rb
filegen-0.4.1 spec/ruby_gen_spec.rb
filegen-0.4.0 spec/ruby_gen_spec.rb