Sha256: f64c366bd12cb1fba42dd72e13e5b4374c77e30b74540da9ce4789b32b1fa759

Contents?: true

Size: 918 Bytes

Versions: 10

Compression:

Stored size: 918 Bytes

Contents

require 'spec_helper'

describe ReverseAsciidoctor do

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

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

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

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

end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
reverse_adoc-0.2.8 spec/components/code_spec.rb
reverse_adoc-0.2.7 spec/components/code_spec.rb
reverse_adoc-0.2.6 spec/components/code_spec.rb
reverse_adoc-0.2.5 spec/components/code_spec.rb
reverse_adoc-0.2.4 spec/components/code_spec.rb
reverse_adoc-0.2.3 spec/components/code_spec.rb
reverse_asciidoctor-0.2.2 spec/components/code_spec.rb
reverse_asciidoctor-0.2.1 spec/components/code_spec.rb
reverse_asciidoctor-0.2.0 spec/components/code_spec.rb
reverse_asciidoctor-0.1.0 spec/components/code_spec.rb