From 71681c733677364aaca2efe679be88b5c113e5fc Mon Sep 17 00:00:00 2001 From: John Bintz Date: Mon, 10 May 2010 11:27:56 -0400 Subject: [PATCH] spec fixes --- lib/apache/rewrites.rb | 2 +- spec/permissions_spec.rb | 2 +- spec/rewrites_spec.rb | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/apache/rewrites.rb b/lib/apache/rewrites.rb index 91c24dd..fee6c58 100644 --- a/lib/apache/rewrites.rb +++ b/lib/apache/rewrites.rb @@ -145,7 +145,7 @@ module Apache when :preserve_query_string 'QSA' end - end + end.sort @options = !options.empty? ? "[#{options * ','}]" : nil end diff --git a/spec/permissions_spec.rb b/spec/permissions_spec.rb index c3f4686..2d6abb1 100644 --- a/spec/permissions_spec.rb +++ b/spec/permissions_spec.rb @@ -15,7 +15,7 @@ describe Apache::Config, "permissions" do it "should allow from somewhere" do 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 # Verify the blob output in apache itself, just make sure the method doesn't bomb diff --git a/spec/rewrites_spec.rb b/spec/rewrites_spec.rb index e7159da..2b8ed2c 100644 --- a/spec/rewrites_spec.rb +++ b/spec/rewrites_spec.rb @@ -72,19 +72,19 @@ end describe Apache::RewriteRule, "a RewriteRule" do subject do rule = Apache::RewriteRule.new - rule.cond('%{REQUEST_FILENAME}', '^/test$') - rule.rule(%r{^/$}, '/test', :last => true, :preserve_query_string => true) + rule.cond('/%{REQUEST_FILENAME}', '^/test$') + rule.rule(%r{^/test$}, '/test2', :last => true, :preserve_query_string => true) rule end - its(:to_s) { should == 'RewriteRule "^/$" "/test" [L,QSA]' } + its(:to_s) { should == 'RewriteRule "^/test$" "/test2" [L,QSA]' } its(:to_a) { should == [ - 'RewriteCond "%{REQUEST_FILENAME}" "^/test$"', - 'RewriteRule "^/$" "/test" [L,QSA]' + 'RewriteCond "/%{REQUEST_FILENAME}" "^/test$"', + 'RewriteRule "^/test$" "/test2" [L,QSA]' ] } - it "should pass the test" do - subject.test('/').should == '/test' + it "should not the test" do + subject.test('/test', :request_filename => 'test').should == '/test2' end end