-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Donte Handy Week 4: IC #8
Open
dontehandy
wants to merge
18
commits into
turingschool-examples:main
Choose a base branch
from
dontehandy:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
…ionality; add RSpec tests
…ss requirement in spec_helper
…and adhere to the single-responsibility principle
…ingle-responsibility principle
…single-responsibility principle
Great reflection on how you are better able to tackle code when you take some time to think about the 'real world' application of these concepts. Its always good to know more about how we work best :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This project was relatively easy to understand after completing the battleship project. Once I slowed down my thinking and followed the initial interaction pattern, I was able to relate it to real-world elections, which felt very timely. I believe that familiarizing myself with real-world processes before coding them into a computer helps with understanding.
This pull request includes significant changes to the Election Tracker project, adding new classes, methods, and tests to support election tracking functionality. The most important changes include the addition of the
Candidate
,Race
, andElection
classes, along with their respective methods and tests.New Class Implementations:
lib/candidate.rb
: Added aCandidate
class with attributesname
,party
, andvotes
, and a methodvote_for
to increment votes. This class follows the single-responsibility principle.lib/race.rb
: Added aRace
class with attributesoffice
andcandidates
, methods to register candidates, check if the race is open, close the race, determine the winner, and check for ties. This class follows the single-responsibility principle.lib/election.rb
: Added anElection
class with attributesyear
andraces
, methods to add races, list candidates, count votes, and determine the winners of each race. This class follows the single-responsibility principle.Documentation Updates:
README.md
: Updated to include detailed interaction patterns for theCandidate
,Race
, andElection
classes, demonstrating how to use the new methods and classes. [1] [2] [3]Test Implementations:
spec/candidate_spec.rb
: Added tests for theCandidate
class to verify its attributes and thevote_for
method.spec/race_spec.rb
: Added tests for theRace
class to verify candidate registration, race status, determining the winner, and checking for ties.spec/election_spec.rb
: Added tests for theElection
class to verify race addition, candidate listing, vote counting, and determining race winners.spec/spec_helper.rb
: Updated to require necessary files and configure RSpec.