Skip to content

Commit

Permalink
Matchers#match_factory now allows class names with '::' syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwhite committed Aug 20, 2010
1 parent 7e11121 commit e49f956
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/pickle/parser/matchers.rb
Expand Up @@ -41,7 +41,7 @@ def match_quoted
end

def match_factory
match_disjunction('\w\w+', *factories)
match_disjunction('(?:\w|::\w){2,}', *factories)
end

def match_plural_factory
Expand Down
2 changes: 1 addition & 1 deletion spec/pickle/parser/matchers_spec.rb
Expand Up @@ -90,7 +90,7 @@ def capture(expected, options = {})
its(:match_predicate) { should match_all '"a super fun thing"', '"a_fun_thing"' }
its(:match_predicate) { should_not match_any 'a_fun_thing' }

its(:match_factory) { should match_all 'user', 'fast_car', 'car' }
its(:match_factory) { should match_all 'user', 'fast_car', 'car', 'Car', 'Fast::Car' }
its(:match_factory) { should_not match_any 'admin users', 'faster car', 'event created' }

its(:match_plural_factory) { should match_all 'users', 'fast_cars', 'cars' }
Expand Down

0 comments on commit e49f956

Please sign in to comment.