Sha256: 063ac4681548e3b0dc5c93cae847f52a5f0b539986515eaa5fca6856c01e12a3

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'
require 'multi_markdown'

describe MultiMarkdown do
  it "should have a VERSION constant" do
    subject.const_get('VERSION').should_not be_empty
  end

  describe "find" do
    it "should raise an ArgumentError for unknown libraries" do
      lambda {
        subject.find(:foo)
      }.should raise_error(ArgumentError)
    end

    it "should raise a NameError when the library could not be found" do
      lambda {
        subject.find(:kramdown)
      }.should raise_error(NameError)
    end
  end

  describe "use" do
    it "should raise an ArgumentError for unknown libraries" do
      lambda {
        subject.use(:foo)
      }.should raise_error(ArgumentError)
    end

    it "should raise a LoadError when the library could not be found" do
      lambda {
        subject.use(:kramdown)
      }.should raise_error(LoadError)
    end
  end

  describe "load" do
    before { Bundler.setup(:redcarpet, :rdiscount) }

    it "should load the first available library" do
      subject.load.name.should == 'RDiscount'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
multi_markdown-0.1.0 spec/multi_markdown_spec.rb
multi_markdown-0.1.0.pre1 spec/multi_markdown_spec.rb