Sha256: 5f278cbaacee5c9e8c37bf8286acf1ac2e7eeddf34dd89af29975b13bb056c6e

Contents?: true

Size: 1015 Bytes

Versions: 4

Compression:

Stored size: 1015 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe Workbench::DynamicHandler do

  before do
    root = File.dirname(__FILE__) + '/fixtures/project'
    @server = Workbench::DynamicHandler.new root
  end

  it '/data.js => /data.js if exists' do
    @server.instance_eval {
      resolve_file('/data.js').should == '/data.js'
    }
  end

  it '/index.html => /index.html if exists' do
    @server.instance_eval {
      resolve_file('/index.html').should == '/index.html'
    }
  end

  it '/ => /index.haml' do
    @server.instance_eval {
      resolve_file('/').should == '/index.haml'
    }
  end

  it '/index => /index.haml' do
    @server.instance_eval {
      resolve_file('/index').should == '/index.haml'
    }
  end

  it '/test.html => /test.haml if file not exists' do
    @server.instance_eval {
      resolve_file('/test.html').should == '/test.haml'
    }
  end

  it '/index.htm => /index.haml' do
    @server.instance_eval {
      resolve_file('/index.htm').should == '/index.haml'
    }
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
work-bench-1.0.12 spec/dynamic_handler_spec.rb
work-bench-1.0.11 spec/dynamic_handler_spec.rb
work-bench-1.0.10 spec/dynamic_handler_spec.rb
work-bench-1.0.9 spec/dynamic_handler_spec.rb