Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

+ specs

  • Loading branch information...
commit 7e047869d425df9828da85b72dd9282f5c04fde8 1 parent a898040
@floere authored
View
8 server/spec/lib/application_spec.rb
@@ -77,6 +77,14 @@ class TestApplication < Application
end
end
+ describe 'check' do
+ it 'does something' do
+ Application.should_receive(:warn).once.with "\nWARNING: No routes defined for application configuration in Class.\n\n"
+
+ Application.check
+ end
+ end
+
describe 'delegation' do
it "should delegate route" do
Application.rack_adapter.should_receive(:route).once.with :path => :query
View
10 server/spec/lib/character_substituters/west_european_spec.rb
@@ -3,8 +3,8 @@
require 'spec_helper'
describe CharacterSubstituters do
- before(:each) do
- @substituter = CharacterSubstituters::WestEuropean.new
+ before(:all) do
+ @substituter = CharacterSubstituters::WestEuropean.new.tap { |s| s.substitute '' }
end
# A bit of metaprogramming to help with the myriads of its.
@@ -33,6 +33,12 @@ def self.it_should_not_substitute(special_character)
result.should < 0.00015
end
end
+
+ describe 'to_s' do
+ it 'outputs correctly' do
+ @substituter.to_s.should == 'CharacterSubstituters::WestEuropean'
+ end
+ end
describe "normal characters" do
it_should_not_substitute('abcdefghijklmnopqrstuvwxyz1234567890')
View
22 server/spec/lib/internals/frontend_adapters/rack_spec.rb
@@ -52,6 +52,11 @@ def rack_defaults_for url
it 'returns the right answer' do
@rack_adapter.empty?.should == false
end
+ describe 'to_s' do
+ it 'outputs correctly' do
+ @rack_adapter.to_s.should == "Note: Anchored (✓) regexps are faster, e.g. /\\A.*\\Z/ or /^.*$/.\n\n something => Search()"
+ end
+ end
end
end
@@ -136,6 +141,14 @@ def rack_defaults_for url
end
end
+ describe 'to_s' do
+ context 'no routes' do
+ it 'outputs correctly' do
+ @rack_adapter.to_s.should == "Note: Anchored (✓) regexps are faster, e.g. /\\A.*\\Z/ or /^.*$/.\n\n"
+ end
+ end
+ end
+
context 'stubbed routes' do
before(:each) do
@routes = stub :routes
@@ -216,6 +229,15 @@ def rack_defaults_for url
end
end
+ describe 'STATUSES' do
+ it 'is a lambda' do
+ Internals::FrontendAdapters::Rack::STATUSES[200].respond_to?(:call).should == true
+ end
+ it 'is a lambda' do
+ Internals::FrontendAdapters::Rack::STATUSES[404].respond_to?(:call).should == true
+ end
+ end
+
describe 'root' do
it 'should call answer' do
@rack_adapter.should_receive(:answer).once.with %r{^/$}, Internals::FrontendAdapters::Rack::STATUSES[200]
View
7 server/spec/lib/sources/csv_spec.rb
@@ -3,6 +3,13 @@
describe Sources::CSV do
+ describe 'to_s' do
+ let(:source) { described_class.new :a, :b, :c, file:'some/file.csv' }
+ it 'outputs the correct string' do
+ source.to_s.should == 'Sources::CSV(a, b, c, {:file=>"some/file.csv"})'
+ end
+ end
+
describe 'without separator' do
before(:each) do
@source = Sources::CSV.new :a, :b, :c, :file => :some_file
Please sign in to comment.
Something went wrong with that request. Please try again.