spec/mojito/base_spec.rb in mojito-0.1.2 vs spec/mojito/base_spec.rb in mojito-0.2.3
- old
+ new
@@ -5,18 +5,34 @@
require 'mojito'
describe Mojito::Base do
subject do
- Mojito.base_application :status_codes do
- on Mojito::Matchers::PATH('test.:extension') do ok! end
+ Mojito::C.runtime_controller Mojito::R::StatusCodes do
+ on PATH('test.:extension') do ok! end
end.mock_request
end
it { subject.get('/test.html').headers.should include('Content-Type') }
it { subject.get('/test.html').headers['Content-Type'].should == 'text/html' }
it { subject.get('/test.txt').headers.should include('Content-Type') }
it { subject.get('/test.txt').headers['Content-Type'].should == 'text/plain' }
it { subject.get('/test.rb').headers.should include('Content-Type') }
it { subject.get('/test.rb').headers['Content-Type'].should == 'application/x-ruby' }
+ context do
+
+ subject do
+ Class.new.tap do |c|
+ c.class_exec do
+ include Mojito::Base
+ end
+ end
+ end
+
+ it { subject.should respond_to(:new).with(1).argument }
+ it { subject.should respond_to(:call).with(1).argument }
+ it { subject.should respond_to(:dispatch).with(1).argument }
+
+ end
+
end
\ No newline at end of file