Skip to content

Instantly share code, notes, and snippets.

@jpinnix
Created March 19, 2009 20:46
Show Gist options
  • Save jpinnix/82051 to your computer and use it in GitHub Desktop.
Save jpinnix/82051 to your computer and use it in GitHub Desktop.
class Test::Unit::TestCase
def self.should_have_default_scope(scope_call, find_options = nil)
klass = model_class
matcher = have_default_scope(scope_call).finding(find_options)
should matcher.description do
assert_accepts matcher.in_context(self), klass.new
end
end
end
def should_have_named_scope(scope_call, find_options = nil)
klass = model_class
matcher = have_named_scope(scope_call).finding(find_options)
should matcher.description do
assert_accepts matcher.in_context(self), klass.new
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment