Module: ElabsMatchers::Matchers::Allow

Defined in:
lib/elabs_matchers/matchers/allow.rb

Defined Under Namespace

Classes: AllowMatcher

Instance Method Summary (collapse)

Instance Method Details

- (Object) allow(*values)

Asserts if a sample value is valid on a given attribute

Example: post.should allow("Elabs").as(:title) post.should_not allow("").as(:title)

post.should allow("Elabs").as(:title, :body) post.should_not allow("").as(:title, :body)

post.should allow("Elabs", "Sweden").as(:title) post.should_not allow("", nil).as(:title)

post.should allow("Elabs", "Sweden").as(:title, :body) post.should_not allow("", nil).as(:title, :body)

Parameters:

  • values (*Array)

    Sample value(s) to check the validation against



124
125
126
# File 'lib/elabs_matchers/matchers/allow.rb', line 124

def allow(*values)
  AllowMatcher.new(values)
end