wetransfer 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdd9e1dde8effa9bce088e6339dd19213adbd865
4
- data.tar.gz: 9b93c2b1712d70f3a127f8b78fd088cf9f9aaf38
3
+ metadata.gz: 1b5bfa1c6ff82d87a1f5bd0df47c3af5ceff2163
4
+ data.tar.gz: 0a285f8cacb13b4ee36c85d1c8dbba71c8b94543
5
5
  SHA512:
6
- metadata.gz: 6e6402e0660e1dab0fca754caae6634562cfc8fe029a05d3a590d481124fb5a04ecf311ce0cd6afdc23a25da9e8063b454105cb91bbe00a1d4b933bd28b2c2de
7
- data.tar.gz: 7a70a9be5367f7f30adafe69b79fd18a197b1aeed22a2e14958352091b9444b0319bb0c1d77110cbba4e4f5c922eee0abcd92cc2814c82476a408b87db92ba3b
6
+ metadata.gz: ceef985fc774024519eeb25ffd454b879148c58241dcee6e82a2c38dddf767ae2711a8e601e15a902a3636fa160d973eb3cf3bde67e8062d6a99b88c374ee01c
7
+ data.tar.gz: 62cfcc59be9f9e197b3cdbd9e43759f406f290edff63b65313568cd3c57e0e730f529b4f328620c56578e553189cc856142b14b28e52b26689c24970396ed26b
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'bundler/setup'
4
- require 'wetransfer'
4
+ require 'we_transfer_client'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -90,6 +90,11 @@ class WeTransferClient
90
90
  create_and_upload(future_transfer)
91
91
  end
92
92
 
93
+ def create_empty_transfer(name:, description:)
94
+ future_transfer = FutureTransfer.new(name: name, description: description, items: [])
95
+ create_and_upload(future_transfer)
96
+ end
97
+
93
98
  def create_and_upload(xfer)
94
99
  authorize_if_no_bearer_token!
95
100
  response = faraday.post(
@@ -1,3 +1,3 @@
1
1
  class WeTransferClient
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
@@ -56,7 +56,7 @@ describe WeTransferClient do
56
56
  expect(response['location']).to start_with('https://wetransfer')
57
57
  end
58
58
 
59
- it 'is able to create a transfer with no items' do
59
+ it 'is able to create a transfer with no items even if passed a block' do
60
60
  client = WeTransferClient.new(api_key: ENV.fetch('WT_API_KEY'), logger: test_logger)
61
61
  response = client.create_transfer(name: 'My amazing board', description: 'Hi there!') do |builder|
62
62
  end
@@ -64,6 +64,13 @@ describe WeTransferClient do
64
64
  expect(response[:items]).to eq([])
65
65
  end
66
66
 
67
+ it 'is able to create a transfer with no items without a block' do
68
+ client = WeTransferClient.new(api_key: ENV.fetch('WT_API_KEY'), logger: test_logger)
69
+ response = client.create_empty_transfer(name: 'My amazing board', description: 'Hi there!')
70
+ expect(response[:size]).to eq(0)
71
+ expect(response[:items]).to eq([])
72
+ end
73
+
67
74
  it 'refuses to create a transfer when reading an IO raises an error' do
68
75
  broken = StringIO.new('hello')
69
76
  def broken.read(*)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wetransfer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Berman