wowget 0.4.1 → 0.4.2
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.
- data/lib/wowget/item.rb +2 -2
- data/lib/wowget.rb +1 -1
- data/spec/item_spec.rb +12 -0
- metadata +1 -1
data/lib/wowget/item.rb
CHANGED
@@ -299,11 +299,11 @@ module Wowget
|
|
299
299
|
end
|
300
300
|
|
301
301
|
def inventory_slot_name
|
302
|
-
INVENTORY_SLOTS[self.inventory_slot_id][:name]
|
302
|
+
self.inventory_slot_id == 0 ? nil : INVENTORY_SLOTS[self.inventory_slot_id][:name]
|
303
303
|
end
|
304
304
|
|
305
305
|
def inventory_slot_slug
|
306
|
-
INVENTORY_SLOTS[self.inventory_slot_id][:slug]
|
306
|
+
self.inventory_slot_id == 0 ? nil : INVENTORY_SLOTS[self.inventory_slot_id][:slug]
|
307
307
|
end
|
308
308
|
|
309
309
|
def to_link
|
data/lib/wowget.rb
CHANGED
data/spec/item_spec.rb
CHANGED
@@ -127,6 +127,18 @@ describe Wowget::Item do
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
+
describe "With an item that cannot be equipped" do
|
131
|
+
item = Wowget::Item.find(35624)
|
132
|
+
|
133
|
+
it "should have no inventory slot name" do
|
134
|
+
item.inventory_slot_name.should == nil
|
135
|
+
end
|
136
|
+
|
137
|
+
it "should have no inventory slot slug" do
|
138
|
+
item.inventory_slot_slug.should == nil
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
130
142
|
describe "When an item name with multiple matches is supplied" do
|
131
143
|
it "should return an array of items" do
|
132
144
|
items = Wowget::Item.find("Titansteel")
|