Strings
Integers/Floats
Arrays
require "minitest/autorun" | |
require "minitest/pride" | |
require "./lib/patron" | |
class PatronTest < Minitest::Test | |
def test_patron_has_attributes | |
patron = Patron.new("Bob") | |
assert_equal "Bob", patron.name |
For this exercise, we're going to use a table of the Presidents of the United States of America.
Let's try out a few things, just to get our hands dirty. We'll use the console in the Chrome developer tools to validate our work.
tr
element.tr
element only.Challenge Part 1:
A fun exercise which is always good Ruby practice is to re-implement an existing Ruby method. This morning, we are going to be re-implementing #reverse
.
Create a file in a folder using touch reverse.rb
In that file, write a method that will take a string as an argument and return that string reversed. Something like this: