Sha256: 97879063c6801017ac581a122a1189f68093a8646646eb35ee9d397f07ccc58c

Contents?: true

Size: 758 Bytes

Versions: 45

Compression:

Stored size: 758 Bytes

Contents

require "rspec"

RSpec.configure do |config|
  config.expect_with :rspec do |c|
    c.syntax = :expect
  end

  config.filter_run focus: true
  config.run_all_when_everything_filtered = true
end

RSpec::Matchers.define :render_html do |html|
  diffable

  match do |markdown|
    @expected = html.strip

    instance = Middleman::HashiCorp::RedcarpetHTML.new
    instance.middleman_app = middleman_app

    options = Middleman::HashiCorp::RedcarpetHTML::REDCARPET_OPTIONS
    parser = Redcarpet::Markdown.new(instance, options)
    @actual = parser.render(markdown).strip

    @expected == @actual
  end
end

# The default middleman application server.
#
# @return [Middleman::Application]
def middleman_app
  @app ||= Middleman::Application.server.inst
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
middleman-hashicorp-0.3.47 spec/spec_helper.rb
middleman-hashicorp-0.3.46 spec/spec_helper.rb
middleman-hashicorp-0.3.45 spec/spec_helper.rb
middleman-hashicorp-0.3.44 spec/spec_helper.rb
middleman-hashicorp-0.3.43 spec/spec_helper.rb
middleman-hashicorp-0.3.41 spec/spec_helper.rb
middleman-hashicorp-0.3.40 spec/spec_helper.rb
middleman-hashicorp-0.3.39 spec/spec_helper.rb
middleman-hashicorp-0.3.38 spec/spec_helper.rb
middleman-hashicorp-0.3.37 spec/spec_helper.rb
middleman-hashicorp-0.3.35 spec/spec_helper.rb
middleman-hashicorp-0.3.34 spec/spec_helper.rb
middleman-hashicorp-0.3.33 spec/spec_helper.rb
middleman-hashicorp-0.3.32 spec/spec_helper.rb
middleman-hashicorp-0.3.31 spec/spec_helper.rb
middleman-hashicorp-0.3.30 spec/spec_helper.rb
middleman-hashicorp-0.3.29 spec/spec_helper.rb
middleman-hashicorp-0.3.28 spec/spec_helper.rb
middleman-hashicorp-0.3.26 spec/spec_helper.rb
middleman-hashicorp-0.3.25 spec/spec_helper.rb