Sha256: 05ddfb8087dcf9a3a9c01d972037afe5b0747501a07d08fb20ad87542009540e

Contents?: true

Size: 873 Bytes

Versions: 7

Compression:

Stored size: 873 Bytes

Contents

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

RSpec.describe Expressir::ExpressExp::HyperlinkFormatter do
  describe ".format" do
    it "formats hyperlink" do
      repo = Expressir::ExpressExp::Parser.from_file(input_file)

      class CustomFormatter < Expressir::ExpressExp::Formatter
        include Expressir::ExpressExp::HyperlinkFormatter
      end
      result = CustomFormatter.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", "hyperlink.exp")
  end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
expressir-0.2.16 spec/expressir/express_exp/hyperlink_formatter_spec.rb
expressir-0.2.16-x86_64-linux spec/expressir/express_exp/hyperlink_formatter_spec.rb
expressir-0.2.16-x86_64-darwin spec/expressir/express_exp/hyperlink_formatter_spec.rb
expressir-0.2.16-x86-mingw32 spec/expressir/express_exp/hyperlink_formatter_spec.rb
expressir-0.2.16-x86-linux spec/expressir/express_exp/hyperlink_formatter_spec.rb
expressir-0.2.16-x64-mingw32 spec/expressir/express_exp/hyperlink_formatter_spec.rb
expressir-0.2.16-arm64-darwin spec/expressir/express_exp/hyperlink_formatter_spec.rb