Skip to content

Latest commit

 

History

History
86 lines (51 loc) · 2.8 KB

README.md

File metadata and controls

86 lines (51 loc) · 2.8 KB
License People Stars Forks Watches Last Updated

Learn TDD with Prime Factors 🧪❌

What is this

prime-factors-tdd is solution for the Prime Factors Kata.

Inspiration

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.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have installed the latest version of ruby and rspec.

Getting prime-factors-tdd

To install prime-factors-tdd, follow these steps:

git clone https://github.com/2kabhishek/prime-factors-tdd
cd prime-factors-tdd

Using prime-factors-tdd

To run the tests: rspec spec/prime_factors_spec.rb To edit the code: $EDITOR prime_factors.rb

How it was built

prime-factors-tdd was built using ruby

Challenges faced

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.

What I learned

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.

What's next

Planning to do more katas like this.

Hit the ⭐ button if you found this useful.

More Info