Sha256: f677f5945bd840b87e80abd751dfd4afec93b103591c1804680d9956bb35cec3

Contents?: true

Size: 686 Bytes

Versions: 2

Compression:

Stored size: 686 Bytes

Contents

# encoding: UTF-8
require 'simplecov' and SimpleCov.start do
	add_filter "spec/"
end
require 'mojito'

describe Mojito::Matchers::VirtualHost do
	
	subject do
		Mojito.application Mojito::Matchers::VirtualHost do
			on HOST('localhost') do write 'localhost' ; halt! end
			on HOST('test:8080') do write 'test' ; halt! end
		end.mock_request
	end
	
	it { subject.get('http://localhost:4444/').body.should == 'localhost' }
	it { subject.get('http://localhost/').body.should == 'localhost' }
	it { subject.get('http://localhost:80/').body.should == 'localhost' }
	it { subject.get('http://test:8080/').body.should == 'test' }
	it { subject.get('http://test/').status.should == 404 }
	
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mojito-0.1.2 spec/mojito/matchers/virtual_host_spec.rb
mojito-0.1.1 spec/mojito/matchers/virtual_host_spec.rb