# encoding: utf-8 require 'spec_helper' describe BikePOA::Client do describe 'parses latest bikepoa status' do it 'extracts the status of several stations' do BikePOA::HttpClient.any_instance.should_receive(:fetch).and_return('html-file') BikePOA::MapParser.any_instance.should_receive(:parse).with('html-file').and_return(%w[line1 line2]) BikePOA::Station.should_receive(:new).with('line1').and_return('station1') BikePOA::Station.should_receive(:new).with('line2').and_return('station2') subject.stations.should include('station1','station2') end end end