lita-cheapshark 0.1.0 → 0.2.0

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: f165d1c9932aea376147a09aca0ef982b7978283
4
- data.tar.gz: 5f8b811b38d2320983e28cb2b0c7c0edd9614eb9
3
+ metadata.gz: cc4ba64364b6866c6228bf54ff09750127122706
4
+ data.tar.gz: 2eac7362781b13833e152c6c3be51147a9516ce4
5
5
  SHA512:
6
- metadata.gz: 1cc74ef26002083550a0cd2599bf040b6864bb6e87dcb5ae7d0e15c5631f566b750a6d1d51ed54b531df7b65197eeb62ca0f89fcfaeeb85db5d2d37bd16d2df4
7
- data.tar.gz: ae0bc0fd13dc2941e47fad269ec9e1b9014f03412c282bbd3698a16b0ebf816168215980ad18c4995b1a5e029e8fa548912595b6141030be182d47eea3edd2aa
6
+ metadata.gz: 369a57310d171cd087a8b159e201fd62d4629c5bff82d5791a240e338e415710a0b2e59263c853df2e3dbc89c82f326cbeb97db2ba7264bb250facaf77b9e119
7
+ data.tar.gz: 73a2afbb9c4beb31b3a3a0db1d4eb89eafa97b458bcf6d84b2d32d49853c4374c7fe0d4e186b6d901fe732ca6e8f93792a3c53a66fb13e687d04a923cacfa7c0
@@ -8,7 +8,7 @@ module Lita
8
8
 
9
9
  def cheapshark(response)
10
10
  term = response.matches[0][0]
11
- data = connection.get("games", title: term).body
11
+ data = JSON.parse(connection.get("games", title: term).body)
12
12
  response.reply("No deal found for '#{term}'") && return if data.size == 0
13
13
  deal = data.first
14
14
  response.reply("Cheapest deal for '#{deal['external']}': $#{deal['cheapest']}")
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-cheapshark"
3
- spec.version = "0.1.0"
3
+ spec.version = "0.2.0"
4
4
  spec.authors = ["Magnus Skog"]
5
5
  spec.email = ["magnus.m.skog@gmail.com"]
6
6
  spec.description = "A Lita handler that returns the best deal for a game from http://www.cheapshark.com"
@@ -6,7 +6,7 @@ describe Lita::Handlers::Cheapshark, lita_handler: true do
6
6
  describe "#cheapshark" do
7
7
  context "with a term with results" do
8
8
  before :each do
9
- stub_request(:get, "#{described_class::CHEAPSHARK_URL}/games").with(query: {title: 'batman: arkham city'}).to_return(body: JSON.parse(File.read('spec/fixtures/games_batman_arkham_city.json')))
9
+ stub_request(:get, "#{described_class::CHEAPSHARK_URL}/games").with(query: {title: 'batman: arkham city'}).to_return(body: File.read('spec/fixtures/games_batman_arkham_city.json'))
10
10
  end
11
11
 
12
12
  it "returns the title of the game, the best deal as well as a url to the deal" do
@@ -19,7 +19,7 @@ describe Lita::Handlers::Cheapshark, lita_handler: true do
19
19
 
20
20
  context "with a term without results" do
21
21
  before :each do
22
- stub_request(:get, "#{described_class::CHEAPSHARK_URL}/games").with(query: {title: 'foobar'}).to_return(body: [])
22
+ stub_request(:get, "#{described_class::CHEAPSHARK_URL}/games").with(query: {title: 'foobar'}).to_return(body: "[]")
23
23
  end
24
24
 
25
25
  it "returns a helpful message" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-cheapshark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus Skog