Sha256: adb21f17852fbc0d3a5b86cd757baa93c3ec7caa3250179246b24610fa03a3b7

Contents?: true

Size: 970 Bytes

Versions: 21

Compression:

Stored size: 970 Bytes

Contents

require "spec_helper"
require "expressir/express_exp/parser"

RSpec.describe Expressir::ExpressExp::Parser do
  describe ".from_files" do
    it "build an instance from multiple files file" do
      repo = Expressir::ExpressExp::Parser.from_files(sample_files)

      schemas = repo.schemas
      expect(schemas.count).to eq(5)
      expect(schemas[0].id).to eq("syntax_schema")
      expect(schemas[1].id).to eq("remark_schema")
      expect(schemas[2].id).to eq("entity_schema")
      expect(schemas[3].id).to eq("version_entity_schema")
      expect(schemas[4].id).to eq("version_interface_entity_schema")
    end
  end

  def sample_files
    @sample_files ||= [
      Expressir.root_path.join(
        "original", "examples", "syntax", "syntax.exp"
      ),
      Expressir.root_path.join(
        "original", "examples", "syntax", "remark.exp"
      ),
      Expressir.root_path.join(
        "original", "examples", "syntax", "source.exp"
      )
    ]
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
expressir-0.2.11 spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.11-x86_64-linux spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.11-x86_64-darwin spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.11-x86-mingw32 spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.11-x86-linux spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.11-x64-mingw32 spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.11-arm64-darwin spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.10 spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.10-x86_64-linux spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.10-x86_64-darwin spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.10-x86-mingw32 spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.10-x86-linux spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.10-x64-mingw32 spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.10-arm64-darwin spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.9 spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.9-x86_64-linux spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.9-x86_64-darwin spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.9-x86-mingw32 spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.9-x86-linux spec/expressir/express_exp/parse_multiple_spec.rb
expressir-0.2.9-x64-mingw32 spec/expressir/express_exp/parse_multiple_spec.rb