From 8ff847b4860c4a8b9632b2be78a1d876c598825e Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 10:12:10 -0500 Subject: [PATCH 01/16] item tests and code for name and price created --- lib/item.rb | 7 +++++++ spec/item_spec.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/lib/item.rb b/lib/item.rb index 85bb5fd..a430144 100644 --- a/lib/item.rb +++ b/lib/item.rb @@ -1,3 +1,10 @@ class Item + attr_reader :name, :price + + def initialize(item_details) + @name = item_details[:name] + @price = item_details[:price] + end + end diff --git a/spec/item_spec.rb b/spec/item_spec.rb index e69de29..3540d02 100644 --- a/spec/item_spec.rb +++ b/spec/item_spec.rb @@ -0,0 +1,26 @@ +require 'rspec' +require './lib/item' + +RSpec.describe Item do + before(:each) do + @item1 = Item.new({name: 'Peach', price: "0.75"}) + @item2 = Item.new({name: 'Tomato', price: "0.50"}) + end + + it 'exists' do + + expect(@item1).to be_an_instance_of(Item) + end + + it 'has a name' do + + expect(@item1.name).to eq("Peach") + end + + it 'has a price' do + + expect(@item1.price).to eq("0.75") + end + + +end \ No newline at end of file From 0b6eb849a0c3c0764755284ba3702ba0ac757c44 Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 10:13:43 -0500 Subject: [PATCH 02/16] added to name and price tests --- spec/item_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/item_spec.rb b/spec/item_spec.rb index 3540d02..87ea293 100644 --- a/spec/item_spec.rb +++ b/spec/item_spec.rb @@ -15,11 +15,13 @@ it 'has a name' do expect(@item1.name).to eq("Peach") + expect(@item2.name).to eq("Tomato") end it 'has a price' do expect(@item1.price).to eq("0.75") + expect(@item2.price).to eq("0.50") end From 0f56a2f8ccaa12e2549c8c0e741bbd9d77a1414a Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 10:16:15 -0500 Subject: [PATCH 03/16] added vendor spec with first test --- spec/vendor_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 spec/vendor_spec.rb diff --git a/spec/vendor_spec.rb b/spec/vendor_spec.rb new file mode 100644 index 0000000..a5f39f0 --- /dev/null +++ b/spec/vendor_spec.rb @@ -0,0 +1,13 @@ +require 'rspec' +require './lib/item' +require '.lib/vendor' + +RSpec.describe Vendor do + before(:each) do + @vendor = Vendor.new("Rocky Mountain Fresh") + end + + it 'exists' do + + expect(@vendor).to be_an_instance_of(Vendor) + end \ No newline at end of file From c63a53e37f96a03234f6d8c76673b865939bc9ea Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 10:28:13 -0500 Subject: [PATCH 04/16] tests and code added for vendor info, some for items --- lib/vendor.rb | 12 ++++++++++++ spec/vendor_spec.rb | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/lib/vendor.rb b/lib/vendor.rb index 6f8cc8b..6af0c20 100644 --- a/lib/vendor.rb +++ b/lib/vendor.rb @@ -1,3 +1,15 @@ class Vendor + attr_reader :name, :inventory, :stock + + def initialize(name) + @name = name + @inventory = {} + end + + def check_stock(item) + @inventory + end + + end diff --git a/spec/vendor_spec.rb b/spec/vendor_spec.rb index a5f39f0..bea158e 100644 --- a/spec/vendor_spec.rb +++ b/spec/vendor_spec.rb @@ -1,6 +1,6 @@ require 'rspec' require './lib/item' -require '.lib/vendor' +require './lib/vendor' RSpec.describe Vendor do before(:each) do @@ -10,4 +10,34 @@ it 'exists' do expect(@vendor).to be_an_instance_of(Vendor) - end \ No newline at end of file + end + + it 'can return the vendor name' do + + expect(@vendor.name).to eq("Rocky Mountain Fresh") + end + + it 'initially returns and empty hash of inventory' do + + expect(@vendor.inventory).to eq({}) + end + + it 'can check the stock of an item' do + + expect(@vendor.check_stock(item1)).to eq(0) + end + + it 'can stock and item' do + @vendor.stock(@item1, 30) + + expect(@vendor.inventory).to include(@item1) + expect(@vendor.check_stock(@item1)).to eq(30) + end + + it 'can stock more items' do + @vendor.stock(@item1, 25) + + expect(@vendor.check_stock(@item1)).to eq(55) + + end +end \ No newline at end of file From 7e008aaf619932024891de51fa2e8fbd468c4216 Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 10:39:08 -0500 Subject: [PATCH 05/16] codes added to pass corresponding tests --- lib/vendor.rb | 14 ++++++++------ spec/vendor_spec.rb | 9 ++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/vendor.rb b/lib/vendor.rb index 6af0c20..438274c 100644 --- a/lib/vendor.rb +++ b/lib/vendor.rb @@ -4,12 +4,14 @@ class Vendor def initialize(name) @name = name - @inventory = {} - end - - def check_stock(item) - @inventory - end + @inventory = Hash.new(0) + end + def check_stock(item) + @inventory[item] + end + def stock(item, quantity) + @inventory[item] += quantity + end end diff --git a/spec/vendor_spec.rb b/spec/vendor_spec.rb index bea158e..4cf1c90 100644 --- a/spec/vendor_spec.rb +++ b/spec/vendor_spec.rb @@ -24,20 +24,19 @@ it 'can check the stock of an item' do - expect(@vendor.check_stock(item1)).to eq(0) + expect(@vendor.check_stock(@item1)).to eq(0) end - it 'can stock and item' do + it 'can stock items' do @vendor.stock(@item1, 30) expect(@vendor.inventory).to include(@item1) expect(@vendor.check_stock(@item1)).to eq(30) - end - it 'can stock more items' do @vendor.stock(@item1, 25) expect(@vendor.check_stock(@item1)).to eq(55) - end + + end \ No newline at end of file From f617b5edcc50dcd6dcc1738990cccfa6998a4fd1 Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 10:41:51 -0500 Subject: [PATCH 06/16] added additional test to complete iteration pattern --- spec/vendor_spec.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/vendor_spec.rb b/spec/vendor_spec.rb index 4cf1c90..2369601 100644 --- a/spec/vendor_spec.rb +++ b/spec/vendor_spec.rb @@ -38,5 +38,11 @@ expect(@vendor.check_stock(@item1)).to eq(55) end - + it 'can stock more items' do + @vendor.stock(@item1, 30) + @vendor.stock(@item1, 25) + @vendor.stock(@item2, 12) + + expect(@vendor.inventory).to include(@item1, @item2) + end end \ No newline at end of file From af330fe6535da74072f5cc3935d4314aaf6181cd Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 10:43:26 -0500 Subject: [PATCH 07/16] market spec created --- spec/market_spec.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 spec/market_spec.rb diff --git a/spec/market_spec.rb b/spec/market_spec.rb new file mode 100644 index 0000000..e69de29 From 4bd69412067e27cd379886101aed9a040836309c Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 10:54:15 -0500 Subject: [PATCH 08/16] initial codes and tests added for it. pattern --- lib/market.rb | 9 +++++++++ spec/market_spec.rb | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/lib/market.rb b/lib/market.rb index 0286ac1..e051fa7 100644 --- a/lib/market.rb +++ b/lib/market.rb @@ -1,3 +1,12 @@ class Market + + attr_reader :name, :vendors + + def initialize(name) + @name = name + @vendors = [] + + end + end diff --git a/spec/market_spec.rb b/spec/market_spec.rb index e69de29..6c0aaf3 100644 --- a/spec/market_spec.rb +++ b/spec/market_spec.rb @@ -0,0 +1,22 @@ +require 'rspec' +require './lib/item' +require './lib/vendor' +require './lib/market' + +RSpec.describe Market do + before(:each)do + @market = Market.new("South Pearl Street Farmers Market") + end + + it 'exists' do + + expect(@market).to be_an_instance_of(Market) + end + + it 'can list all vendors in the market' do + + expect(@market.vendors).to eq([]) + end + + +end \ No newline at end of file From 2e5bf3a683015d04e57688eb1fd666e1f3a1f5d0 Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 10:55:50 -0500 Subject: [PATCH 09/16] test to return market name added --- spec/market_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/market_spec.rb b/spec/market_spec.rb index 6c0aaf3..1245123 100644 --- a/spec/market_spec.rb +++ b/spec/market_spec.rb @@ -13,6 +13,11 @@ expect(@market).to be_an_instance_of(Market) end + it 'can return the market name' do + + expect(@market.name).to eq("South Pearl Street Farmers Market") + end + it 'can list all vendors in the market' do expect(@market.vendors).to eq([]) From 1172a50cb9356a41c1cc5cfed6f447e95b66c824 Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 11:05:54 -0500 Subject: [PATCH 10/16] created test and code to add vendors to market --- lib/market.rb | 4 ++++ spec/market_spec.rb | 26 ++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/lib/market.rb b/lib/market.rb index e051fa7..42b946c 100644 --- a/lib/market.rb +++ b/lib/market.rb @@ -1,11 +1,15 @@ class Market attr_reader :name, :vendors + attr_accessor :add_vendor def initialize(name) @name = name @vendors = [] + end + def add_vendor(vendor) + @vendors << vendor end diff --git a/spec/market_spec.rb b/spec/market_spec.rb index 1245123..5791221 100644 --- a/spec/market_spec.rb +++ b/spec/market_spec.rb @@ -6,6 +6,7 @@ RSpec.describe Market do before(:each)do @market = Market.new("South Pearl Street Farmers Market") + end it 'exists' do @@ -17,11 +18,32 @@ expect(@market.name).to eq("South Pearl Street Farmers Market") end - + it 'can list all vendors in the market' do expect(@market.vendors).to eq([]) end - + it 'can add vendors to the market' do + @vendor1 = Vendor.new("Rocky Mountain Fresh") + @item1 = Item.new({name: 'Peach', price: "$0.75"}) + @item2 = Item.new({name: 'Tomato', price: "$0.50"}) + @item3 = Item.new({name: "Peach-Raspberry Nice Cream", price: "$5.30"}) + @item4 = Item.new({name: "Banana Nice Cream", price: "$4.25"}) + @vendor1.stock(@item1, 35) + @vendor1.stock(@item2, 7) + + @vendor2 = Vendor.new("Ba-Nom-a-Nom") + @vendor2.stock(@item4, 50) + @vendor2.stock(@item3, 25) + + @vendor3 = Vendor.new("Palisade Peach Shack") + @vendor3.stock(@item1, 65) + + @market.add_vendor(@vendor1) + @market.add_vendor(@vendor2) + @market.add_vendor(@vendor3) + + expect(@market.vendors).to include(@vendor1, @vendor2, @vendor3) + end end \ No newline at end of file From 55352918e9b11c9d5c31a49dd5ed11e04c511d7c Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 11:21:03 -0500 Subject: [PATCH 11/16] added vendors that sell method --- lib/market.rb | 13 ++++++++++++- spec/market_spec.rb | 25 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/lib/market.rb b/lib/market.rb index 42b946c..d4f43eb 100644 --- a/lib/market.rb +++ b/lib/market.rb @@ -1,7 +1,6 @@ class Market attr_reader :name, :vendors - attr_accessor :add_vendor def initialize(name) @name = name @@ -11,6 +10,18 @@ def initialize(name) def add_vendor(vendor) @vendors << vendor end + + def vendor_names + vendors.map do |vendor| + vendor.name + end + end + + def vendors_that_sell(item) + vendors.select do |vendor| + vendor.check_stock(item) > 0 + end +end end diff --git a/spec/market_spec.rb b/spec/market_spec.rb index 5791221..feb7deb 100644 --- a/spec/market_spec.rb +++ b/spec/market_spec.rb @@ -46,4 +46,29 @@ expect(@market.vendors).to include(@vendor1, @vendor2, @vendor3) end + + it 'can return vendor names, items sold at vendors, and vendor revenue' do + @vendor1 = Vendor.new("Rocky Mountain Fresh") + @item1 = Item.new({name: 'Peach', price: "$0.75"}) + @item2 = Item.new({name: 'Tomato', price: "$0.50"}) + @item3 = Item.new({name: "Peach-Raspberry Nice Cream", price: "$5.30"}) + @item4 = Item.new({name: "Banana Nice Cream", price: "$4.25"}) + @vendor1.stock(@item1, 35) + @vendor1.stock(@item2, 7) + + @vendor2 = Vendor.new("Ba-Nom-a-Nom") + @vendor2.stock(@item4, 50) + @vendor2.stock(@item3, 25) + + @vendor3 = Vendor.new("Palisade Peach Shack") + @vendor3.stock(@item1, 65) + + @market.add_vendor(@vendor1) + @market.add_vendor(@vendor2) + @market.add_vendor(@vendor3) + + expect(@market.vendor_names).to eq(["Rocky Mountain Fresh", "Ba-Nom-a-Nom", "Palisade Peach Shack"]) + expect(@market.vendors_that_sell(@item1)).to eq([@vendor1, @vendor3]) + end + end \ No newline at end of file From 6b6edc6069b1ec3d94b0bdcee5cd66cf0c5f4c1e Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 11:42:10 -0500 Subject: [PATCH 12/16] added code and test for potential revenue --- lib/market.rb | 4 ++-- lib/vendor.rb | 12 +++++++++++- spec/market_spec.rb | 6 ++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/market.rb b/lib/market.rb index d4f43eb..48dbcfb 100644 --- a/lib/market.rb +++ b/lib/market.rb @@ -1,6 +1,7 @@ class Market attr_reader :name, :vendors + attr_accessor :potential_revenue def initialize(name) @name = name @@ -22,6 +23,5 @@ def vendors_that_sell(item) vendor.check_stock(item) > 0 end end - - + end diff --git a/lib/vendor.rb b/lib/vendor.rb index 438274c..a4c9589 100644 --- a/lib/vendor.rb +++ b/lib/vendor.rb @@ -1,6 +1,7 @@ class Vendor attr_reader :name, :inventory, :stock + attr_accessor :potential_revenue def initialize(name) @name = name @@ -11,7 +12,16 @@ def check_stock(item) @inventory[item] end - def stock(item, quantity) + def stock(item, quantity) @inventory[item] += quantity end + + def potential_revenue + total_revenue = 0 + @inventory.each do |item, quantity| + item_price = item.price.delete('$').to_f + total_revenue += item_price * quantity + end + total_revenue + end end diff --git a/spec/market_spec.rb b/spec/market_spec.rb index feb7deb..33ed8bc 100644 --- a/spec/market_spec.rb +++ b/spec/market_spec.rb @@ -68,7 +68,13 @@ @market.add_vendor(@vendor3) expect(@market.vendor_names).to eq(["Rocky Mountain Fresh", "Ba-Nom-a-Nom", "Palisade Peach Shack"]) + expect(@market.vendors_that_sell(@item1)).to eq([@vendor1, @vendor3]) + expect(@market.vendors_that_sell(@item4)).to eq([@vendor2]) + + expect(@vendor1.potential_revenue).to eq(29.75) + expect(@vendor2.potential_revenue).to eq(345.00) + expect(@vendor3.potential_revenue).to eq(48.75) end end \ No newline at end of file From 13e367efa7df3679b561b49816104f026068f0c2 Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 12:18:42 -0500 Subject: [PATCH 13/16] list all items added --- lib/market.rb | 12 ++++++++++-- lib/vendor.rb | 2 ++ spec/market_spec.rb | 3 +++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/market.rb b/lib/market.rb index 48dbcfb..85e7606 100644 --- a/lib/market.rb +++ b/lib/market.rb @@ -1,7 +1,7 @@ class Market attr_reader :name, :vendors - attr_accessor :potential_revenue + attr_accessor :sorted_item_list def initialize(name) @name = name @@ -23,5 +23,13 @@ def vendors_that_sell(item) vendor.check_stock(item) > 0 end end - + + def sorted_item_list + all_item_names = vendors.flat_map do |vendor| + vendor.inventory.keys.map(&:name) + end + all_item_names.uniq.sort + end + + def end diff --git a/lib/vendor.rb b/lib/vendor.rb index a4c9589..c5910dd 100644 --- a/lib/vendor.rb +++ b/lib/vendor.rb @@ -9,10 +9,12 @@ def initialize(name) end def check_stock(item) + @inventory[item] ||= 0 @inventory[item] end def stock(item, quantity) + @inventory[item] ||= 0 @inventory[item] += quantity end diff --git a/spec/market_spec.rb b/spec/market_spec.rb index 33ed8bc..b907b8c 100644 --- a/spec/market_spec.rb +++ b/spec/market_spec.rb @@ -75,6 +75,9 @@ expect(@vendor1.potential_revenue).to eq(29.75) expect(@vendor2.potential_revenue).to eq(345.00) expect(@vendor3.potential_revenue).to eq(48.75) + + expect(@market.sorted_item_list).to eq(["Banana Nice Cream", "Peach", "Peach-Raspberry Nice Cream", "Tomato"]) + end end \ No newline at end of file From a7fe0579d8eaa15b77a6c2554c4177c842a15e15 Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 12:36:48 -0500 Subject: [PATCH 14/16] total inventory added --- lib/market.rb | 19 ++++++++++++++++++- spec/market_spec.rb | 8 +++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/lib/market.rb b/lib/market.rb index 85e7606..fbaf59c 100644 --- a/lib/market.rb +++ b/lib/market.rb @@ -31,5 +31,22 @@ def sorted_item_list all_item_names.uniq.sort end - def + def total_inventory + inventory = {} + vendors.each do |vendor| + vendor.inventory.each do |item, quantity| + + if inventory[item] + inventory[item][:quantity] += quantity + inventory[item][:vendors] << vendor.name unless inventory[item][:vendors].include?(vendor.name) + else + inventory[item] = { + quantity: quantity, + vendors: [vendor.name] + } + end + end + end + inventory + end end diff --git a/spec/market_spec.rb b/spec/market_spec.rb index b907b8c..71931ae 100644 --- a/spec/market_spec.rb +++ b/spec/market_spec.rb @@ -78,6 +78,12 @@ expect(@market.sorted_item_list).to eq(["Banana Nice Cream", "Peach", "Peach-Raspberry Nice Cream", "Tomato"]) - end + expected = { + @item1 => { quantity: 100, vendors: ["Rocky Mountain Fresh", "Palisade Peach Shack"] }, + @item2 => { quantity: 7, vendors: ["Rocky Mountain Fresh"] } + } + + expect(@market.total_inventory).to include(expected) + end end \ No newline at end of file From fb5228432ca87e58f0c874ab3d00a0ac83042ebb Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 12:43:30 -0500 Subject: [PATCH 15/16] added overstocked items --- lib/market.rb | 10 ++++++++++ spec/market_spec.rb | 2 ++ 2 files changed, 12 insertions(+) diff --git a/lib/market.rb b/lib/market.rb index fbaf59c..cc2db66 100644 --- a/lib/market.rb +++ b/lib/market.rb @@ -49,4 +49,14 @@ def total_inventory end inventory end + + def overstocked_items + overstocked = [] + total_inventory.each do |item, data| + if data[:vendors].length > 1 && data[:quantity] > 50 + overstocked << item + end + end + overstocked + end end diff --git a/spec/market_spec.rb b/spec/market_spec.rb index 71931ae..49474c8 100644 --- a/spec/market_spec.rb +++ b/spec/market_spec.rb @@ -84,6 +84,8 @@ } expect(@market.total_inventory).to include(expected) + + expect(@market.overstocked_items).to eq([@item1]) end end \ No newline at end of file From c150d9ba5682e232dd1367ca54042fa2ff698d57 Mon Sep 17 00:00:00 2001 From: Natasha Vasquez Date: Mon, 16 Sep 2024 12:54:42 -0500 Subject: [PATCH 16/16] cleaned up codes and tests, thought about attempting it4, but not enough time --- lib/market.rb | 6 +++--- lib/vendor.rb | 32 ++++++++++++++++---------------- spec/item_spec.rb | 2 -- spec/market_spec.rb | 3 +-- 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/lib/market.rb b/lib/market.rb index cc2db66..6a5e33a 100644 --- a/lib/market.rb +++ b/lib/market.rb @@ -21,8 +21,8 @@ def vendor_names def vendors_that_sell(item) vendors.select do |vendor| vendor.check_stock(item) > 0 + end end -end def sorted_item_list all_item_names = vendors.flat_map do |vendor| @@ -46,8 +46,8 @@ def total_inventory } end end - end - inventory + end + inventory end def overstocked_items diff --git a/lib/vendor.rb b/lib/vendor.rb index c5910dd..258073b 100644 --- a/lib/vendor.rb +++ b/lib/vendor.rb @@ -6,24 +6,24 @@ class Vendor def initialize(name) @name = name @inventory = Hash.new(0) - end + end - def check_stock(item) - @inventory[item] ||= 0 - @inventory[item] - end + def check_stock(item) + @inventory[item] ||= 0 + @inventory[item] + end - def stock(item, quantity) - @inventory[item] ||= 0 - @inventory[item] += quantity - end + def stock(item, quantity) + @inventory[item] ||= 0 + @inventory[item] += quantity + end - def potential_revenue - total_revenue = 0 - @inventory.each do |item, quantity| - item_price = item.price.delete('$').to_f - total_revenue += item_price * quantity + def potential_revenue + total_revenue = 0 + @inventory.each do |item, quantity| + item_price = item.price.delete('$').to_f + total_revenue += item_price * quantity + end + total_revenue end - total_revenue - end end diff --git a/spec/item_spec.rb b/spec/item_spec.rb index 87ea293..d41b79b 100644 --- a/spec/item_spec.rb +++ b/spec/item_spec.rb @@ -23,6 +23,4 @@ expect(@item1.price).to eq("0.75") expect(@item2.price).to eq("0.50") end - - end \ No newline at end of file diff --git a/spec/market_spec.rb b/spec/market_spec.rb index 49474c8..afcd540 100644 --- a/spec/market_spec.rb +++ b/spec/market_spec.rb @@ -86,6 +86,5 @@ expect(@market.total_inventory).to include(expected) expect(@market.overstocked_items).to eq([@item1]) - end - + end end \ No newline at end of file