-
Notifications
You must be signed in to change notification settings - Fork 7
[WIP] Isolate Board Object #48
base: master
Are you sure you want to change the base?
Conversation
… to be applied onto corresponding object
# the board url is set | ||
expect(board.url =~ %r|https://we.tl/b-|).to be_truthy | ||
# Upload all the files by giving the IO of the file | ||
board.upload_file!(io: File.open(__FILE__, 'rb')) |
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.
Is the order of uploading important?
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.
nope totally irrelevant, The user has to responsibility to upload and complete the files. If not, they don't show up.
describe WeTransfer::Client::Boards do | ||
describe WeTransfer::Boards do | ||
before do | ||
skip |
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 are all tests skipped?
describe '#initialize' do | ||
it 'initializes with an empty array' do | ||
expect(subject.items.empty?).to be(true) | ||
it 'initializes with instance variable @files' 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.
Is it important to know the types and maybe even the names of (potentially private) instance vars?
end | ||
|
||
it 'is an array of files and links' do | ||
expect(subject.items).to be_kind_of(Array) |
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.
this test is something else than what it says on the description. Can this be more in line?
expect(subject.items).to be_kind_of(Array) | ||
end | ||
|
||
it 'shows all items that were added' 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.
it 'shows all
-> it 'knows how many
?
end | ||
|
||
it 'succeeds if given all arguments' do | ||
described_class.new(params) | ||
end | ||
|
||
it 'transfors integer names to strings' 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.
Maybe rename 'transfors integer names to strings' into 'converts names into strings'?
expect(new_file.name).to be_kind_of(String) | ||
end | ||
|
||
it 'stringed filesizes are converted to integers' 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.
idem
expect(response).to be_kind_of(WeTransfer::RemoteFile) | ||
end | ||
|
||
it 'raises an error when board doenst exists' 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.
doenst
it '#io' do | ||
subject.io | ||
describe 'Transfer behaviour' do | ||
# Todo! |
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.
indeed
|
||
it '#name' do | ||
subject.name | ||
it 'raises an error when file is not io compliant' 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.
it 'raises an error when the file is empty' do
Proposed changes
Simplify the behavior of objects. Make the client less of a place where everything is handled but let the objects handle it them self.
Types of changes
What types of changes does your code introduce to wetransfer_ruby_sdk?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...