Sha256: 5090fd93523814d92e30ee7d72f34953086e107bf1ab29495c92dd0b5e771421

Contents?: true

Size: 790 Bytes

Versions: 1

Compression:

Stored size: 790 Bytes

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'

describe CITLunch do
  context "when get menus" do
    it "should create Menu objects from JSON" do

      entry = [{ :price => 10,
                 :name => "うまい棒",
                 :details => ["サラダ味", "めんたいこ味"]}]

      client = CITLunch::Client.new
      client.should_receive(:open).and_return(StringIO.new(entry.to_json))
      menus = client.get_today(:tsuda_dining)

      menus.first.price.should == entry.first[:price]
      menus.first.name.should == entry.first[:name]
      menus.first.details.should == entry.first[:details]
    end

    it "raise ArgumentError if illegal place specified" do
      lambda { CITLunch.get_today(:nonexistent_place) }.should raise_error(ArgumentError)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pebbles-citlunch-0.0.3 spec/citlunch_spec.rb