Sha256: c344ef24c6428e6471079b2d6729d6708e2f6541778f4c68b02cae305fd029dc

Contents?: true

Size: 757 Bytes

Versions: 4

Compression:

Stored size: 757 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../test_helper')

Expectations do
  
  expect false do
    validation = Validatable::ValidatesPresenceOf.new stub_everything, :name
    validation.valid?(stub_everything)
  end
  
  expect true do
    validation = Validatable::ValidatesPresenceOf.new stub_everything, :name
    validation.valid?(stub(:name=>"book"))
  end
  
  expect true do
    validation = Validatable::ValidatesPresenceOf.new stub_everything, :employee
    validation.valid?(stub(:employee => stub(:nil? => false)))
  end
  
  expect true do
    options = {:message => nil, :if => nil, :times => nil, :level => nil, :groups => nil}
    Validatable::ValidatesPresenceOf.new(stub_everything, :test).must_understand(options)
  end
  
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
mack-notifier-0.8.2 lib/gems/validatable-1.6.7/test/unit/validates_presence_of_test.rb
mack-notifier-0.8.3 lib/gems/validatable-1.6.7/test/unit/validates_presence_of_test.rb
mack-notifier-0.8.3.1 lib/gems/validatable-1.6.7/test/unit/validates_presence_of_test.rb
validatable-1.6.7 test/unit/validates_presence_of_test.rb