In this section I learned about the Enumerable module that gets mixed into the Array and Hash classes (among others) and provides you with lots of handy iterator methods. To prove that there’s no magic to it, you’re going to rebuild those methods.
I had to use yield
and the #call
method to accomplished.
- Ruby 2.6
In order to start with the project:
- You need to have ruby environment installed. Click here for instructions
- Clone this repository 📘
- Run the algorithm file
- In a terminal window write
ruby
[your_file_path]
enumerable_method_asignment.rb
- In a terminal window write
We are using RSpec testing tool to test all enumerable methods. Also some detailed documentation about this tool
- In a terminal window type
gem install rspec
- Once rspec install has finished, type
rspec --init
- You will see a folder
spec
and a file.rspec
- Inside
spec
folder you'll see aspec_helper.rb
file.
We have already created a file called
enumerable_spec.rb
, if you want to create another one with the end[your file name]
_spec.rb
- Open
./spec/enumerable_spec.rb
file - Open a terminal window and type
rspec
- If all test were passed you will see:
Else you'll see a red message, then check errors and fix them
👤 Bertil Tandayamo
- Github: @bertil291utn
- Twitter: @btandayamo
- Linkedin: Bertil Tandayamo
This was a solo project, but to write testing part I got a hand from my colleague
👤 Bekhzod Akhrorov
- Github:@Bekhzod96
- Twitter: @Begzod
- Linkedin:@Bekhzod AKhrorov
Contributions, issues and feature requests are welcome!
Give a ⭐️ if you like this project!