diff --git a/lib/menu.rb b/lib/menu.rb index c227466acc..22c3784034 100644 --- a/lib/menu.rb +++ b/lib/menu.rb @@ -10,23 +10,19 @@ class Menu Feta_sauce: 1.00, } -attr_reader :order_choice +attr_reader :order_choice, :stock def initialize + @stock = stock @order_choice = Hash.new end def menu_dishes # defined method MENU_LIST # calls items from CONSTANT above end - - def order(item, price) # order method defined, arguments must have an item and a price - order_choice[item] = price - end - end -order = Menu.new -p order.menu_dishes -p order.order_choice +# order = Menu.new +# p order.menu_dishes +# p order.order_choice diff --git a/spec/menu_spec.rb b/spec/menu_spec.rb index 05eaaa3983..2228ac90f0 100644 --- a/spec/menu_spec.rb +++ b/spec/menu_spec.rb @@ -2,15 +2,15 @@ describe Menu do - subject(:menu){described_class.new} + describe 'initialize' do + it 'initialize blank hash for order choice' do + expect(subject.order_choice).to be_empty + end + end it 'should give user a list of menu dishes' do expect(subject.menu_dishes).to eq Menu::MENU_LIST end - it 'should add selected items to selected list' do - order_choice = {:food => 6} - subject.order(:food, 6) - expect(subject.order_choice).to eq order_choice - end + end