Sha256: 32d59921fb7972dc19fd77756112eb8d895b251b9041922a8bb2c74d5518fc2f

Contents?: true

Size: 565 Bytes

Versions: 6

Compression:

Stored size: 565 Bytes

Contents

require "spec_helper"

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

  ["0/0 rescue a", "0/0 rescue 0/0 rescue 'nope'"].each do |input|
    context input do
      let!(:input) { input }

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

  [
    "a /* cool */ rescue b",
    "a rescue /* cool */ b",
    "a rescue b /* cool */ rescue c",
    "a rescue b eescue /* 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

6 entries across 6 versions & 2 rubygems

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