https://github.com/ruthmoog/makers_secret_diary
Just a simple diary that needs to be unlocked to see or change what's inside.
https://github.com/ruthmoog/makers_secret_diary
Last synced: 2 months ago
JSON representation
Just a simple diary that needs to be unlocked to see or change what's inside.
- Host: GitHub
- URL: https://github.com/ruthmoog/makers_secret_diary
- Owner: ruthmoog
- Created: 2019-06-07T11:12:21.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-11T21:17:29.000Z (almost 6 years ago)
- Last Synced: 2025-01-26T05:42:51.174Z (4 months ago)
- Language: Ruby
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Secret Diary
Just a simple diary that needs to be unlocked to see or change what's inside.
```
SecretDiary
- lock
- unlock
- add_entry
- get_entriesInitially the `SecretDiary` class is locked, meaning `add_entry` and `get_entries` should throw an error.
When the user calls `unlock`, `add_entry` and `get_entries` should work as desired.
When the user calls `lock` again they throw errors again.
```## More info
I've used RSpec & TDD to create the files.
I considered cohesion and encapsulation and seperated the code into two classes.
So that the tests would be uncoupled, I used doubles and spies to test the diary behavior without relying on the `Lock` class.
## Run the tests
install RSpec and run in the command line with `rspec` in the main directory.
## Resources
Secret Diary is a practical OO exersize from Makers Academy