admirerbrown / Rspec_TDD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ“— Table of Contents

πŸ“– Practice Test Driven Development(TDD)

In this project you will implement a class with some methods, but you will do it by doing test-driven development (TDD). Remember that the idea is to write tests first and then the code. #Project requirements

  • Create a class called Solver. Create a method called factorial that takes one argument, an integer N, and returns the factorial for that number. The factorial is the multiplication of all integers from 1 to N and has the special case that the factorial of 0 is 1. This method only accepts 0 and positive integers, so if a negative integer is given it should raise an exception. Create a method called reverse that takes one argument, a string word, and returns word reversed (e.g. if word is "hello" it returns "olleh").
  • Create a method called fizzbuzz that takes one argument, an integer N, and returns a string. The returned string is constructed following these rules: When N is divisible by 3, return "fizz". When N is divisible by 5, return "buzz". When N is divisible by 3 and 5, return "fizzbuzz". Any other case, return N as a string (e.g. say N is 7 then return "7"). Remember to start with tests for all of the methods described above. Your commit history should prove that you have used TDD.

πŸ›  Built With

πŸ›  Tech Stack

  • Ruby
  • Rspec
  • Client

    Key Features

    • serves as good practice for TDD.
    • Reverse a string app.
    • FizzBuzz app

    (back to top)

    (back to top)

    πŸ’» Getting Started

    To get a local copy up and running, follow these steps.

    Prerequisites

    In order to run this project you need:

    • Mac or PC
    • Install Ruby
    • Understanding of Ruby
    • IRB
    • Gems to test linters
    • RSpec to run tests

    Setup

    Clone this repository to your desired folder:

      cd into your-folder
     git clone https://github.com/admirerbrown/Rspec_TDD.git

    Install

    Install this project with:

    • GitHub Actions
    • Linters
    • Rubocop
    • Ruby
    • Rspec

    Usage

    • Use this project as a step to learning to practice building backend applications with Ruby and OOP concepts.
    • run "Rspec your-file-name"

    (back to top)

    πŸ‘₯ Author

    πŸ‘€ Samuel Kyere

    (back to top)

    πŸ”­ Future Features

    • **Add more practice classes **
    • Add more complex requirements
    • Add console interface

    (back to top)

    🀝 Contributing

    Contributions, issues, and feature requests are welcome!

    Feel free to check the issues page.

    (back to top)

    ⭐️ Show your support

    If you like this project, please leave a ⭐️

    (back to top)

    πŸ™ Acknowledgments

    I would like to thank Microverse for providing us with reading materials that aided us to during the project development

    (back to top)

    ❓ FAQ

    • Can I use this code?

      • yes, it is open source. Feel free to fork it.
    • Can I contribute to this project?

      • Contact me so I can add you as a collaborator. Alternatively you can leave an issue, it will be well appreciated.

    (back to top)

    πŸ“ License

    This project is MIT licensed.

    (back to top)

    About

    License:MIT License


    Languages

    Language:Ruby 100.0%