Sha256: c1b4336f10e301777abcc2411e49b5018b97dc5b6987f3fe1ab61d057ea372db

Contents?: true

Size: 604 Bytes

Versions: 6

Compression:

Stored size: 604 Bytes

Contents

require "spec_helper"

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

  [
    "class A",
    "class A self.b = 1",
    "class A < B",
    "class A end",
    "class A self.b = 1 end",
    "class A < B end"
  ].each do |input|
    context input do
      let!(:input) { input }

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

  [
    "class /* cool */ A",
    "class A /* cool */ < B",
    "class A </* cool */ B"
  ].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/class_spec.rb
code-ruby-parser-0.1.2 spec/code/parser/class_spec.rb
template-ruby-parser-0.1.1 spec/code/parser/class_spec.rb
code-ruby-parser-0.1.1 spec/code/parser/class_spec.rb
template-ruby-parser-0.1.0 spec/code/parser/class_spec.rb
code-ruby-parser-0.1.0 spec/code/parser/class_spec.rb