Fetching contributors…
Cannot retrieve contributors at this time
37 lines (29 sloc) 966 Bytes
require 'picky'
require_relative 'model'
# This will output nothing on the first run,
# but the server will dump/reload even
# when stopping/starting.
p "Expected: Nothing, Nothing OR 1, 1"
p 'surname:mcnama*'
p 'picky'
picky = 'Picky', surname: 'McNamara')
florian = 'Florian', surname: 'Hanke')
tentacles = 'Tentacles', surname: 'Jellyfish')
p "Expected: 1, 1"
p 'surname:mcnama*'
p 'hanke'
florian.update_attributes! name: 'Kaspar', surname: 'Schiess'
tentacles.update_attributes! name: 'Roger', surname: 'Braun'
p "Expected: Nothing, 1, 1"
p 'hanke' # Not found anymore.
p 'surname:schies*'
p 'roger'
p "Expected: Nothing, Nothing"
p 'surname:schies*' # (Not found anymore)
p 'roger' # And out. (Not found anymore)