Sha256: 6f6bbff0f4da89938297b3c88f209478e36f1d7b9861d19f1ec9cccea3af8084

Contents?: true

Size: 712 Bytes

Versions: 40

Compression:

Stored size: 712 Bytes

Contents

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

RSpec.describe Expressir::ExpressExp::Formatter do
  describe ".format" do
    it "formats a file" do
      repo = Expressir::ExpressExp::Parser.from_exp(input_file)

      result = Expressir::ExpressExp::Formatter.format(repo)
      expected_result = File.read(output_file)

      expect(result).to eq(expected_result)
    end
  end

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

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

Version data entries

40 entries across 40 versions & 1 rubygems

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