Guest User

Untitled

a guest
May 16th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. require 'exemplor'
  2.  
  3. eg 'working with an array' do
  4. names = %w{Michael Tim Myles}
  5. Check(names)[names]
  6.  
  7. # Output for disambiguation is not pretty
  8. # (I) working with an array:
  9. # (i) names MichaelTimMyles:
  10. # - Michael
  11. # - Tim
  12. # - Myles
  13. end
  14.  
  15. eg 'working with a hash' do
  16. person = {:name => 'Michael', :email => 'mkoukoullis@gmail.com', :mobile => 0413310401}
  17. Check(person)[person]
  18.  
  19. # Output for disambiguation is not pretty
  20. # (I) working with a hash:
  21. # (i) person emailmkoukoullis@gmail.comnameMichaelmobile70095105:
  22. # :email: mkoukoullis@gmail.com
  23. # :name: Michael
  24. # :mobile: 70095105
  25. end
  26.  
  27. eg 'working with an array of hashes' do
  28. people = [{:name => 'Michael', :email => 'mkoukoullis@gmail.com', :mobile => 0413310401},
  29. {:name => 'Myles', :email => 'mylesbyrne@gmail.com', :mobile => 0404562452}]
  30. Check(people)[people]
  31.  
  32. # Output for disambiguation is not pretty
  33. # (I) working with an array of hashes:
  34. # (i) people emailmkoukoullis@gmail.comnameMichaelmobile70095105emailmylesbyrne@gmail.comnameMylesmobile68347178:
  35. # - :email: mkoukoullis@gmail.com
  36. # :name: Michael
  37. # :mobile: 70095105
  38. # - :email: mylesbyrne@gmail.com
  39. # :name: Myles
  40. # :mobile: 68347178
  41. end
Add Comment
Please, Sign In to add comment