Created
November 18, 2009 00:55
-
-
Save kouky/237447 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'exemplor' | |
eg 'working with an array' do | |
names = %w{Michael Tim Myles} | |
Check(names)[names] | |
# Output for disambiguation is not pretty | |
# (I) working with an array: | |
# (i) names MichaelTimMyles: | |
# - Michael | |
# - Tim | |
# - Myles | |
end | |
eg 'working with a hash' do | |
person = {:name => 'Michael', :email => 'mkoukoullis@gmail.com', :mobile => 0413310401} | |
Check(person)[person] | |
# Output for disambiguation is not pretty | |
# (I) working with a hash: | |
# (i) person emailmkoukoullis@gmail.comnameMichaelmobile70095105: | |
# :email: mkoukoullis@gmail.com | |
# :name: Michael | |
# :mobile: 70095105 | |
end | |
eg 'working with an array of hashes' do | |
people = [{:name => 'Michael', :email => 'mkoukoullis@gmail.com', :mobile => 0413310401}, | |
{:name => 'Myles', :email => 'mylesbyrne@gmail.com', :mobile => 0404562452}] | |
Check(people)[people] | |
# Output for disambiguation is not pretty | |
# (I) working with an array of hashes: | |
# (i) people emailmkoukoullis@gmail.comnameMichaelmobile70095105emailmylesbyrne@gmail.comnameMylesmobile68347178: | |
# - :email: mkoukoullis@gmail.com | |
# :name: Michael | |
# :mobile: 70095105 | |
# - :email: mylesbyrne@gmail.com | |
# :name: Myles | |
# :mobile: 68347178 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment