Sha256: 26614113b76744d0634332fec9aa68b9dbef24a1fc6991a36eb5a8753bc84c86

Contents?: true

Size: 543 Bytes

Versions: 6

Compression:

Stored size: 543 Bytes

Contents

require "spec_helper"

RSpec.describe ::Code::Parser do
  subject { ::Code::Parser.parse(input) }

  ["[]", "[1]", "[1,2]", "[1,[true]]"].each do |input|
    context input do
      let!(:input) { input }

      it { expect { subject }.to_not raise_error }
    end
  end

  [
    "[ /* cool */ ]",
    "[ /* cool */ 1 ]",
    "[ 1 /* cool */ ]",
    "[ 1, /* cool */ 2 ]",
    "[ 1, 2 /* cool */ ]"
  ].each do |input|
    context input do
      let!(:input) { input }

      it { expect(subject.to_json).to include("cool") }
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
template-ruby-parser-0.1.2 spec/code/parser/list_spec.rb
code-ruby-parser-0.1.2 spec/code/parser/list_spec.rb
template-ruby-parser-0.1.1 spec/code/parser/list_spec.rb
code-ruby-parser-0.1.1 spec/code/parser/list_spec.rb
template-ruby-parser-0.1.0 spec/code/parser/list_spec.rb
code-ruby-parser-0.1.0 spec/code/parser/list_spec.rb