Sha256: 94fffd7bf72eabdf95831f46c85d91588c79b44dce0e73965500c55e2aa1c5a0

Contents?: true

Size: 660 Bytes

Versions: 3

Compression:

Stored size: 660 Bytes

Contents

require "wlang"

describe "The wlang/xhtml dialect" do
  
  it("should provide helpers to create links") {
    "@{/details}".wlang({}, 'wlang/xhtml').should == "/details"
    "@{/details}{Details}".wlang({}, 'wlang/xhtml').should == '<a href="/details">Details</a>'
  }
  
  it("should provide to_xhtml_link callback on links") {
    ::String.module_eval do
      def to_xhtml_link(url, label) 
        "#{url}:#{label}"
      end
      def to_xhtml_href(url)
        "Hello:#{url}"
      end
    end
    "@{/details}{Details}".wlang({}, 'wlang/xhtml').should == '/details:Details'
    "@{/details}".wlang({}, 'wlang/xhtml').should == 'Hello:/details'
  }

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wlang-0.10.0 test/spec/xhtml_dialect.spec
wlang-0.9.2 test/spec/xhtml_dialect.spec
wlang-0.9.1 test/spec/xhtml_dialect.spec