prime-factors-tdd is solution for the Prime Factors Kata.
This was inspired by Robert Martin's Three Laws of TDD talk. He gives the demo in Kotlin, but I wanted to try it in Ruby.
Before you begin, ensure you have met the following requirements:
- You have installed the latest version of
ruby
andrspec
.
To install prime-factors-tdd, follow these steps:
git clone https://github.com/2kabhishek/prime-factors-tdd
cd prime-factors-tdd
To run the tests: rspec spec/prime_factors_spec.rb
To edit the code: $EDITOR prime_factors.rb
prime-factors-tdd was built using ruby
Setting up rspec withhout rails and bundler was somewhat tricky. rspec --init
did the work.
Also require_relative
was very handy for importing the source code.
While building prime-factors-tdd I learned about:
- Setting up rspec without rails and bundler.
- Using
require_relative
to import the source code. - Some ruby best practices.
- How good TDD is.
Planning to do more katas like this.
Hit the ⭐ button if you found this useful.