Sha256: 79edbc5b74e61394d5973449fa006d873bdea4ecfd80d7adb2b302da97e4e4b5

Contents?: true

Size: 739 Bytes

Versions: 3

Compression:

Stored size: 739 Bytes

Contents

# frozen_string_literal: true

RSpec.describe TTY::Markdown, 'link' do
  let(:symbols) { TTY::Markdown.symbols }

  it "converts link" do
    markdown =<<-TEXT
[I'm an inline-style link](https://www.google.com)
    TEXT
    parsed = TTY::Markdown.parse(markdown)
    expect(parsed).to eq([
      "I#{symbols[:rsquo]}m an inline-style link #{symbols[:arrow]} \e[33;4mhttps://www.google.com\e[0m\n"
    ].join)
  end

  it "converts link with title" do
    markdown =<<-TEXT
[I'm an inline-style link with title](https://www.google.com "Google's Homepage")
    TEXT
    parsed = TTY::Markdown.parse(markdown)
    expect(parsed).to eq([
      "Google's Homepage #{symbols[:arrow]} \e[33;4mhttps://www.google.com\e[0m\n"
    ].join)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tty-markdown-0.6.0 spec/unit/parse/link_spec.rb
tty-markdown-0.5.1 spec/unit/parse/link_spec.rb
tty-markdown-0.5.0 spec/unit/parse/link_spec.rb