Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

[WIP] Isolate Board Object #48

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open

Conversation

davidenko87
Copy link
Contributor

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 apply

  • Docs (missing or updated docs)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement / maintenance (removing technical debt, performance, tooling, etc...)

Checklist

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.

  • I have read the CONTRIBUTING doc
  • I have added necessary documentation (if appropriate)
  • Code changes are covered by unit tests.
  • Any dependent changes have been merged and published in downstream modules

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...

# 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'))
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor

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)
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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!
Copy link
Contributor

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
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants