-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add Faker::ElectricalComponents #799
Add Faker::ElectricalComponents #799
Conversation
…utput when running rake task, all tests pass
… assertion for active class added, implementation in progress
lib/faker/electrical_components.rb
Outdated
module Faker | ||
class ElectricalComponents < Base | ||
flexible :electrical_components | ||
def active |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the flexible key above, can these methods be removed and the tests still pass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No they can not, I get NoMethodError: undefined method
[]' for nil:NilClass`` errors for each method if they are not present. I included this code because an error message from the test suite prompted me to: warning: instance variable @flexible_key not initialized
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
a359def
to
a5d7731
Compare
* test setup added for electrical components, test is included in test utput when running rake task, all tests pass * add require path to faker.rb, add elec component file in faker/, test assertion for active class added, implementation in progress * test passes for active method, more additions to come * add Electrical Components - active to docs * passive test passing, add passive components to en.yml * add docs for passive * add test and functionality for electromechanical components, all tests pass * add docs for electromechanical * remove unnecessary class << self code * fix spacing and indentation * Update changelog.md * Update readme.md * Minor change
Hello, please review this PR for adding an assortment of electrical components to the Faker code base. I have included three methods or 'categories' of electrical components: active, passive, and electromechanical. Tests have been added and are passing; documentation has been added to reflect the categories with examples of each in the docs.