backpack_tf 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,29 @@
1
+ require 'backpack_tf'
2
+ require 'webmock/rspec'
3
+
4
+ def generate_fake_api_key
5
+ hex_nums = %w(0 1 2 3 4 5 6 7 8 9 a b c d e f)
6
+ key = ''
7
+ 24.times{ |k| key << hex_nums.sample }
8
+ key
9
+ end
10
+
11
+ # taken from httparty's spec dir
12
+ # https://github.com/jnunemaker/httparty/blob/master/spec/spec_helper.rb
13
+ def file_fixture(filename)
14
+ File.open( File.join( File.dirname(__FILE__), "fixtures", "#{filename}")).read
15
+ end
16
+
17
+ # taken from httparty's spec dir
18
+ # https://github.com/jnunemaker/httparty/blob/master/spec/spec_helper.rb
19
+ def stub_http_response_with(filename)
20
+ format = filename.split('.').last.intern
21
+ data = file_fixture(filename)
22
+ response = Net::HTTPOK.new('1.1', 200, 'Content for you')
23
+ allow(response).to receive(:body).and_return(data)
24
+
25
+ http_request = HTTParty::Request.new(Net::HTTP::Get, 'http://localhost', format: format)
26
+ allow(http_request).to receive_message_chain(:http, :request).and_return(response)
27
+
28
+ expect(HTTParty::Request).to receive(:new).and_return(http_request)
29
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backpack_tf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Espinoza
@@ -75,7 +75,29 @@ email: rafael@rafaelespinoza.com
75
75
  executables: []
76
76
  extensions: []
77
77
  extra_rdoc_files: []
78
- files: []
78
+ files:
79
+ - ".gitignore"
80
+ - Gemfile
81
+ - Gemfile.lock
82
+ - TODO.md
83
+ - backpack_tf.gemspec
84
+ - lib/backpack_tf.rb
85
+ - lib/backpack_tf/client.rb
86
+ - lib/backpack_tf/currencies.rb
87
+ - lib/backpack_tf/item.rb
88
+ - lib/backpack_tf/item_price.rb
89
+ - lib/backpack_tf/prices.rb
90
+ - lib/backpack_tf/response.rb
91
+ - readme.md
92
+ - spec/backpack_tf/client_spec.rb
93
+ - spec/backpack_tf/currencies_spec.rb
94
+ - spec/backpack_tf/item_spec.rb
95
+ - spec/backpack_tf/prices_spec.rb
96
+ - spec/backpack_tf/response_spec.rb
97
+ - spec/fixtures/currencies.json
98
+ - spec/fixtures/item.json
99
+ - spec/fixtures/prices.json
100
+ - spec/spec_helper.rb
79
101
  homepage: https://github.com/NerdDiffer/backpack_tf
80
102
  licenses:
81
103
  - MIT