Sha256: ef805a39406d5d8bbe182979f0e78e27a1eb8d97f379a6bfb53e5db86ca108fb

Contents?: true

Size: 1.54 KB

Versions: 3

Compression:

Stored size: 1.54 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe Brightly::Provider do
  it "returns html processed by markdown" do
    post '/brighten', {:markdown => File.read(File.dirname(__FILE__) + '/data/simple.markdown'), :theme => 'blackboard'}
    last_response.body.should == File.read(File.dirname(__FILE__) + '/data/simple.html')
  end

  it "returns html processed by markdown with ruby highlighted" do
    post '/brighten', {:markdown => File.read(File.dirname(__FILE__) + '/data/code.markdown'), :theme => 'blackboard'}
    last_response.body.should == File.read(File.dirname(__FILE__) + '/data/code.html')
  end

  it "returns html processed by markdown with html highlighted when there are nested <code> tags" do
    post '/brighten', {:markdown => File.read(File.dirname(__FILE__) + '/data/nested.markdown'), :theme => 'blackboard'}
    last_response.body.should == File.read(File.dirname(__FILE__) + '/data/nested.html')
  end

  it "returns html processed by markdown with embed javascript" do
    post '/brighten', {:markdown => File.read(File.dirname(__FILE__) + '/data/javascript.markdown'), :theme => 'blackboard'}
    last_response.body.should == File.read(File.dirname(__FILE__) + '/data/javascript.html')
  end

  it "returns html processed by markdown without double nesting parts of the highlighted code" do
    post '/brighten', {:markdown => File.read(File.dirname(__FILE__) + '/data/double_nest.markdown'), :theme => 'blackboard'}
    last_response.body.should == File.read(File.dirname(__FILE__) + '/data/double_nest.html')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
brightly-0.1.3 spec/brightly_spec.rb
brightly-0.1.2 spec/brightly_spec.rb
brightly-0.1.1 spec/brightly_spec.rb