Sha256: 752d822dc45c4535314b99af7c8dc08f538b425b903f6f959f3e91db41b1a5dc

Contents?: true

Size: 908 Bytes

Versions: 10

Compression:

Stored size: 908 Bytes

Contents

require_relative "../lib/geo"

describe Sunweather::Geo, "after initializing with a string" do
	let (:geo) { Sunweather::Geo.new("test") }

  it "contains data which is useful" do
    expect(geo.data).not_to be_nil
    expect(geo.data[0].data["geometry"]["location"]["lat"]).to be_within(90).of(0)
    expect(geo.data[0].data["geometry"]["location"]["lng"]).to be_within(180).of(0)
    expect(geo.lat).to be_within(90).of(0)
    expect(geo.lng).to be_within(180).of(0)
  end
end

describe Sunweather::Geo, "after initializing without a string" do
	let (:geo) { Sunweather::Geo.new }

  it "contains data which is useful" do
    expect(geo.data).not_to be_nil
    expect(geo.data[0].data["geometry"]["location"]["lat"]).to be_within(90).of(0)
    expect(geo.data[0].data["geometry"]["location"]["lng"]).to be_within(180).of(0)
    expect(geo.lat).to eq(51.713741)
    expect(geo.lng).to eq(8.770812)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sunweather-0.3.8 spec/geo_spec.rb
sunweather-0.3.7 spec/geo_spec.rb
sunweather-0.3.6 spec/geo_spec.rb
sunweather-0.3.5 spec/geo_spec.rb
sunweather-0.3.4 spec/geo_spec.rb
sunweather-0.3.3 spec/geo_spec.rb
sunweather-0.3.2 spec/geo_spec.rb
sunweather-0.3.1 spec/geo_spec.rb
sunweather-0.3.0 spec/geo_spec.rb
sunweather-0.2.0 spec/geo_spec.rb