Sha256: 6cc5fb984df57d0fe45acfeffde9f0e2fde4f54f621ba7dfd607d36f3f67d7ad

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Barometer::WebService::NoaaStation, :vcr => {
  :cassette_name => "WebService::NoaaStation"
} do
  before(:each) do
    @latitude = "34.10"
    @longitude = "-118.41"
  end

  describe "and the class methods" do
    describe "fetch," do
      it "requires latitude" do
        Barometer::WebService::NoaaStation.should_receive("_fetch").never
        Barometer::WebService::NoaaStation.fetch(nil,@longitude)
      end

      it "requires longitude" do
        Barometer::WebService::NoaaStation.should_receive("_fetch").never
        Barometer::WebService::NoaaStation.fetch(@latitude,nil)
      end

      it "queries" do
        Barometer::WebService::NoaaStation.fetch(@latitude,@longitude).should_not be_nil
      end

      it "returns a string" do
        Barometer::WebService::NoaaStation.fetch(@latitude,@longitude).is_a?(String).should be_true
        Barometer::WebService::NoaaStation.fetch(@latitude,@longitude).should == "KSMO"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
barometer-0.8.0 spec/web_services/noaa_station_id_spec.rb