Sha256: 88083ccb46dc385ee616b13485d5f928c8f325bb55e346ca074133b92f0344a6

Contents?: true

Size: 668 Bytes

Versions: 1

Compression:

Stored size: 668 Bytes

Contents

require 'spec_helper'

describe Unicafe do

  let(:restaurant_name) {"example restaurant"}

  it "should be able to give specific restaurant" do
    restaurant_mock = mock(Unicafe::Restaurant)
    Unicafe::Restaurant.should_receive(:find_by_name).with(restaurant_name).and_return(restaurant_mock)

    Unicafe.get_restaurant(restaurant_name).should == restaurant_mock
  end

  it "should raise error if specific restaurant can't be found" do
    Unicafe::Restaurant.should_receive(:find_by_name).with(restaurant_name).and_raise(Unicafe::Restaurant::NotFound)
    expect{Unicafe.get_restaurant(restaurant_name)}.to raise_error(Unicafe::Restaurant::NotFound)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unicafe-0.0.3 spec/unicafe_spec.rb