Sha256: 25f1e3b0f3bcbeae0de59c9e9ecd51deacba972c9f030c22d1dcc6f0e27d5d11

Contents?: true

Size: 1.05 KB

Versions: 28

Compression:

Stored size: 1.05 KB

Contents

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

RSpec.describe Expressir::ExpressExp::SchemaHeadFormatter do
  describe ".format" do
    it "formats schema head" do
      repo = Expressir::ExpressExp::Parser.from_file(sample_file)

      result = Expressir::ExpressExp::SchemaHeadFormatter.format(repo)

      expect(result).to eq(<<~EXP.strip
        SCHEMA syntax_schema 'version';
        USE FROM contract_schema;
        USE FROM contract_schema
          (contract);
        USE FROM contract_schema
          (contract, contract2);
        USE FROM contract_schema
          (contract AS contract2);
        REFERENCE FROM contract_schema;
        REFERENCE FROM contract_schema
          (contract);
        REFERENCE FROM contract_schema
          (contract, contract2);
        REFERENCE FROM contract_schema
          (contract AS contract2);
      EXP
      )
    end
  end

  def sample_file
    @sample_file ||= Expressir.root_path.join("original", "examples", "syntax", "syntax.exp")
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
expressir-0.2.15 spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.15-x86_64-linux spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.15-x86_64-darwin spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.15-x86-mingw32 spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.15-x86-linux spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.15-x64-mingw32 spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.15-arm64-darwin spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.14 spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.14-x86_64-linux spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.14-x86_64-darwin spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.14-x86-mingw32 spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.14-x86-linux spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.14-x64-mingw32 spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.14-arm64-darwin spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.13 spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.13-x86_64-linux spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.13-x86_64-darwin spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.13-x86-mingw32 spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.13-x86-linux spec/expressir/express_exp/schema_head_formatter_spec.rb
expressir-0.2.13-x64-mingw32 spec/expressir/express_exp/schema_head_formatter_spec.rb