Sha256: e2e8bbbd73973bc56c3ec4cc2406ce48f8cc431cabc59b93a986491adc7fa2ac

Contents?: true

Size: 861 Bytes

Versions: 2

Compression:

Stored size: 861 Bytes

Contents

require 'spec_helper'

describe ReverseAdoc do

  let(:input)    { File.read('spec/assets/code.html') }
  let(:document) { Nokogiri::HTML(input) }
  subject { ReverseAdoc.convert(input) }

  it { is_expected.to match /inline `code` block/ }
  it { is_expected.to match /\nvar this;\nthis\.is/ }
  it { is_expected.to match /block"\)\nconsole/ }

  context "with github style code blocks" do
    subject { ReverseAdoc.convert(input) }
    it { is_expected.to match /inline `code` block/ }
    it { is_expected.to match /\n\.\.\.\.\nvar this;\nthis/ }
    it { is_expected.to match /it is"\) ?\n	\n\.\.\.\./ }
  end

  context "code with indentation" do
    subject { ReverseAdoc.convert(input) }
    it { is_expected.to match(/^tell application "Foo"\n/) }
    it { is_expected.to match(/^    beep\n/) }
    it { is_expected.to match(/^end tell\n/) }
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
reverse_adoc-0.3.7 spec/components/code_spec.rb
reverse_adoc-0.3.6 spec/components/code_spec.rb