Sha256: adab42b24a85f324355f990c734c0c5e6197ab3560185611c84eeee38b5392eb

Contents?: true

Size: 506 Bytes

Versions: 12

Compression:

Stored size: 506 Bytes

Contents

require "spec_helper"

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

  ["a if b", "a if b if c", "a unless b"].each do |input|
    context input do
      let!(:input) { input }

      it { subject }
    end
  end

  [
    "a /* cool */ if b",
    "a if /* cool */ b",
    "a if b if c /* cool */",
    "a unless b if /* cool */ c"
  ].each do |input|
    context input do
      let!(:input) { input }

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

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
template-ruby-parser-0.1.8 spec/code/parser/if_modifier_spec.rb
code-ruby-parser-0.1.8 spec/code/parser/if_modifier_spec.rb
template-ruby-parser-0.1.7 spec/code/parser/if_modifier_spec.rb
code-ruby-parser-0.1.7 spec/code/parser/if_modifier_spec.rb
template-ruby-parser-0.1.6 spec/code/parser/if_modifier_spec.rb
code-ruby-parser-0.1.6 spec/code/parser/if_modifier_spec.rb
template-ruby-parser-0.1.5 spec/code/parser/if_modifier_spec.rb
code-ruby-parser-0.1.5 spec/code/parser/if_modifier_spec.rb
template-ruby-parser-0.1.4 spec/code/parser/if_modifier_spec.rb
code-ruby-parser-0.1.4 spec/code/parser/if_modifier_spec.rb
template-ruby-parser-0.1.3 spec/code/parser/if_modifier_spec.rb
code-ruby-parser-0.1.3 spec/code/parser/if_modifier_spec.rb