-
Notifications
You must be signed in to change notification settings - Fork 27
Sockets - Evelynn and Shirley #7
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
… subsequent tests
slack.rbWhat We're Looking For
|
|
|
||
| # private | ||
|
|
||
| def self.list |
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.
Why is private commented out?
| module Slack | ||
| class Workspace | ||
| attr_reader :users, :channels | ||
| attr_accessor :selected |
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.
I think an attr_reader might be the right call for selected as well, since it's only changing from within this class.
| def select_channel(value) | ||
| @channels.each do |channel| | ||
| if channel.name == value | ||
| @selected = channel |
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.
You have a lot of repeated code between this method and select_user above. Is there a way you could DRY this up?
| id = "cat" | ||
| selected_user = @workspace.select_user(id) | ||
|
|
||
| expect(selected_user).must_be_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.
What happens to a previously selected user?
|
|
||
| it "returns nil if no recipient" do | ||
| expect(@workspace.show_details).must_be_nil | ||
| end |
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.
You've done a great job throughout this project of identifying and testing failure cases.
slack.rb
Congratulations! You're submitting your assignment!
You and your partner should collaborate on the answers to these questions.
Comprehension Questions