-
Notifications
You must be signed in to change notification settings - Fork 27
PORTS - Kim&Cloudy #1
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
base: master
Are you sure you want to change the base?
Conversation
…ur user interface
… been tested and run properly
slack.rbWhat We're Looking For
|
| end | ||
|
|
||
| def details | ||
| super.push("topic", "member_count") |
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.
Very clever 👍
| end | ||
|
|
||
| def self.get(url, params) | ||
| user_data = HTTParty.get(url, query: params) |
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.
It's not always user data, so this variable name could use some improvement.
| end | ||
|
|
||
| def self.list | ||
| raise NotImplementedError, "Implement me in a child class!" |
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.
🥇
| end | ||
|
|
||
| def select_user(user_descriptor) | ||
| users.find do |user| |
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.
When using find it's intended to be used like this:
@selected = users.find do |user|
user_descriptor == user.name || user_descriptor == user.slack_id
end| end | ||
| end | ||
|
|
||
| if @selected == nil |
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.
There's a subtle error in the way you have it written. Consider:
- I select a valid user
- Then I try to select an invalid user name
- Since
@selectedis notnilwe won't get the returned error message.
| end | ||
| end | ||
|
|
||
| def select_channel(channel_descriptor) |
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.
See notes for select_user
Also if you notice the methods are identical... you could have one method that does both!
| end | ||
|
|
||
| describe "#send_message" do | ||
| it "raises an Error if incorrect parameters are given" do |
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.
So maybe verify that it must_raise
| @@ -0,0 +1,156 @@ | |||
| require_relative "test_helper" | |||
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.
Nice testing here!
slack.rb
Congratulations! You're submitting your assignment!
You and your partner should collaborate on the answers to these questions.
Comprehension Questions