Sha256: 230e425348db1835648fbe8d81d50efd1fd1d36af3145b711eac44c337a9c2dc

Contents?: true

Size: 458 Bytes

Versions: 12

Compression:

Stored size: 458 Bytes

Contents

require "spec_helper"

RSpec.describe Template::Parser::Template do
  subject { described_class.new.parse(input) }

  [
    ["hello", [{ text: "hello" }]],
    ["hello {name}", [{ text: "hello " }, { code: [{ name: "name" }] }]],
    ["{name", [{ code: [{ name: "name" }] }]],
  ].each do |(input, expected)|
    context input.inspect do
      let(:input) { input }

      it "succeeds" do
        expect(subject).to eq(expected)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
template-ruby-0.4.0 spec/template/parser/template_spec.rb
code-ruby-0.4.0 spec/template/parser/template_spec.rb
template-ruby-0.3.1 spec/template/parser/template_spec.rb
code-ruby-0.3.1 spec/template/parser/template_spec.rb
template-ruby-0.3.0 spec/template/parser/template_spec.rb
code-ruby-0.3.0 spec/template/parser/template_spec.rb
code-ruby-0.2.4 spec/template/parser/template_spec.rb
template-ruby-0.2.4 spec/template/parser/template_spec.rb
template-ruby-0.2.3 spec/template/parser/template_spec.rb
template-ruby-0.2.2 spec/template/parser/template_spec.rb
template-ruby-0.2.1 spec/template/parser/template_spec.rb
template-ruby-0.2.0 spec/template/parser/template_spec.rb