Skip to content

Commit

Permalink
Fix typo matching :any status
Browse files Browse the repository at this point in the history
  • Loading branch information
lmarburger committed Dec 28, 2012
1 parent 51b7216 commit 2498a90
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/leadlight/tint_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'addressable/template'
require 'addressable/uri'
require 'delegate'
require 'mime/types'

Expand Down Expand Up @@ -78,7 +80,7 @@ def expand_status_patterns(*patterns)
patterns.inject([]) {|patterns, pattern|
case pattern
when :any
pattern << (100..599)
patterns << (100..599)
when :user_error
patterns << (400..499)
when :server_error
Expand Down
10 changes: 10 additions & 0 deletions spec/leadlight/tint_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require 'spec_helper_lite'
require 'addressable/template'
require 'addressable/uri'
require 'leadlight/tint_helper'

module Leadlight
Expand Down Expand Up @@ -134,6 +136,14 @@ module Leadlight
baz
end
end

it 'accepts pattern shortcuts' do
object.should_receive(:baz)
subject.exec_tint do
match_status(:any)
baz
end
end
end

describe '#match' do
Expand Down

0 comments on commit 2498a90

Please sign in to comment.