Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rack/rewrite/rule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def match(path)

def string_matches?(string, matcher)
if self.is_a_regexp?(matcher)
string =~ matcher
(string =~ matcher) != nil
elsif matcher.is_a?(String)
string == matcher
elsif matcher.is_a?(Symbol)
Expand Down
2 changes: 1 addition & 1 deletion test/rule_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class RuleTest < Test::Unit::TestCase
class RuleTest < ZeroTest

TEST_ROOT = File.dirname(__FILE__)

Expand Down
15 changes: 14 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,17 @@ def rack_env_for(url, options = {})

def supported_status_codes
[:r301, :r302, :r303, :r307]
end
end

class ZeroTest < Test::Unit::TestCase
def assert(test, msg= nil)
if test.class == Fixnum && test.zero?
super(false)
end
if msg.nil?
super(test)
else
super(test, msg)
end
end
end