spec fixes

This commit is contained in:
John Bintz 2010-05-10 11:27:56 -04:00
parent e6d92383e7
commit 71681c7336
3 changed files with 9 additions and 9 deletions

View File

@ -145,7 +145,7 @@ module Apache
when :preserve_query_string when :preserve_query_string
'QSA' 'QSA'
end end
end end.sort
@options = !options.empty? ? "[#{options * ','}]" : nil @options = !options.empty? ? "[#{options * ','}]" : nil
end end

View File

@ -15,7 +15,7 @@ describe Apache::Config, "permissions" do
it "should allow from somewhere" do it "should allow from somewhere" do
apache.allow_from '1.2.3.4' apache.allow_from '1.2.3.4'
apache.to_a.should == [ 'Allow from 1.2.3.4' ] apache.to_a.should == [ 'Allow from "1.2.3.4"' ]
end end
# Verify the blob output in apache itself, just make sure the method doesn't bomb # Verify the blob output in apache itself, just make sure the method doesn't bomb

View File

@ -72,19 +72,19 @@ end
describe Apache::RewriteRule, "a RewriteRule" do describe Apache::RewriteRule, "a RewriteRule" do
subject do subject do
rule = Apache::RewriteRule.new rule = Apache::RewriteRule.new
rule.cond('%{REQUEST_FILENAME}', '^/test$') rule.cond('/%{REQUEST_FILENAME}', '^/test$')
rule.rule(%r{^/$}, '/test', :last => true, :preserve_query_string => true) rule.rule(%r{^/test$}, '/test2', :last => true, :preserve_query_string => true)
rule rule
end end
its(:to_s) { should == 'RewriteRule "^/$" "/test" [L,QSA]' } its(:to_s) { should == 'RewriteRule "^/test$" "/test2" [L,QSA]' }
its(:to_a) { should == [ its(:to_a) { should == [
'RewriteCond "%{REQUEST_FILENAME}" "^/test$"', 'RewriteCond "/%{REQUEST_FILENAME}" "^/test$"',
'RewriteRule "^/$" "/test" [L,QSA]' 'RewriteRule "^/test$" "/test2" [L,QSA]'
] } ] }
it "should pass the test" do it "should not the test" do
subject.test('/').should == '/test' subject.test('/test', :request_filename => 'test').should == '/test2'
end end
end end