If ‘minitest’ is installed I don’t even know why the entire test runs at
all
If you’d install Ruby 2.2.3 from scratch (and not upgrading from earlier
versions) test-unit wouldn’t get installed so “require ‘test/unit’”
should fail.
BUT: you are calling methods from the test that doesn’t exist in
‘lexicon.rb’:
The #peek method doesn’t exist (only #initialize, #scan and #convert_number)
Rewrite the test: 1. to use minitest (minitest has different testing
paradigms, choose the one that resembles most to the test/unit
TestCase), 2. call the proper methods
=========
Hint: You are using nested method definition here:
def scan(input)
input = input.split
out = []
def convert_number(inp)
begin
Integer inp
Ruby has NO nested methods. Up until the point #scan is not invoked, #convert_number won’t exist.
A side note: give your class and method names something more
descriptive, do not be afraid of them being 20-30 characters long, like
“use_readable_variables”.
Thanks for your help.
I have attached the parse.rb file where I have declared the peek and
other methods.
And it seems like I have another gem installed named
“test-unit-minitest”
I forgot to notify that to you before because I was using 1.9.3.
When I switched to 2.2.3 I noticed this gem.