Sha256: 31b0c7a5441c34cc974af345d7efe86477903dc032dcfa8662a4b75207ffbc65

Contents?: true

Size: 900 Bytes

Versions: 13

Compression:

Stored size: 900 Bytes

Contents

require File.expand_path('../../../spec_helper', __FILE__)
module Noe
  describe "Template::Entry#infer_wlang_dialect" do
    
    subject{ Template::Entry.infer_wlang_dialect(uri, default) }
    let(:default){ nil }
    
    context "when invoked on explicit wlang dialects extensions" do
      let(:uri){ "test.wtpl" }
      it{ should == "wlang/xhtml" }
    end
    
    context "when invoked on implicit wlang dialects extensions" do
      let(:uri){ "test.rb" }
      it{ should == "wlang/ruby" }
    end
    
    context "when invoked on something else and a default value" do
      let(:uri){ "test.notanextension" }
      let(:default){ "hello" }
      it{ should == "hello" }
    end
    
    context "when invoked on something else and no default value" do
      let(:uri){ "test.notanextension" }
      let(:default){ nil }
      it{ should == "wlang/active-text" }
    end
    
  end 
end

Version data entries

13 entries across 11 versions & 1 rubygems

Version Path
noe-1.7.3 spec/unit/template/entry/infer_wlang_dialect_spec.rb
noe-1.7.2 spec/unit/template/entry/infer_wlang_dialect_spec.rb
noe-1.7.1 spec/unit/template/entry/infer_wlang_dialect_spec.rb
noe-1.7.0 spec/unit/template/entry/infer_wlang_dialect_spec.rb
noe-1.6.0 spec/unit/template/entry/infer_wlang_dialect_spec.rb
noe-1.5.1 spec/unit/template/entry/infer_wlang_dialect_spec.rb
noe-1.5.0 spec/unit/template/entry/infer_wlang_dialect_spec.rb
noe-1.4.0 spec/unit/template/entry/infer_wlang_dialect_spec.rb
noe-1.3.0 spec/template/entry/infer_wlang_dialect_spec.rb
noe-1.2.0 spec/template/entry/infer_wlang_dialect_spec.rb
noe-1.2.0 ./spec/template/entry/infer_wlang_dialect_spec.rb
noe-1.1.0 ./spec/template/entry/infer_wlang_dialect_spec.rb
noe-1.1.0 spec/template/entry/infer_wlang_dialect_spec.rb