Sha256: 631d446063b1cc1711128f67b44cd1384c1af2904834c332ae6d36544a90bcc1

Contents?: true

Size: 696 Bytes

Versions: 3

Compression:

Stored size: 696 Bytes

Contents

require File.expand_path('../spec_helper', __FILE__)
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 2 versions & 1 rubygems

Version Path
wlang-0.10.2 spec/xhtml_dialect.spec
wlang-0.10.1 ./spec/xhtml_dialect.spec
wlang-0.10.1 spec/xhtml_dialect.spec