-
-
Save ps-97/d7c8d62b7362108eee98f6cb4b10a7ab to your computer and use it in GitHub Desktop.
Bookstore Unit Testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # bookstore_spec.rb | |
| require 'rspec' | |
| class Bookstore | |
| attr_reader :books | |
| def initialize | |
| @books = [] | |
| end | |
| def add_book(book) | |
| @books << book | |
| end | |
| def total_price | |
| end | |
| def book_titles | |
| end | |
| def find_books_by_author(author) | |
| end | |
| def cheapest_book | |
| end | |
| end | |
| class Book | |
| attr_reader :title, :author, :price | |
| def initialize(title, author, price) | |
| @title = title | |
| @author = author | |
| @price = price | |
| end | |
| end | |
| RSpec.describe Bookstore do | |
| describe '#add_book' do | |
| end | |
| describe '#total_price' do | |
| end | |
| describe '#book_titles' do | |
| end | |
| describe '#find_books_by_author' do | |
| end | |
| describe '#cheapest_book' do | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment