Skip to content

Commit

Permalink
prefix RSpec on first describe in spec files
Browse files Browse the repository at this point in the history
  • Loading branch information
attack committed Jul 20, 2014
1 parent 8699e1f commit 5b6975e
Show file tree
Hide file tree
Showing 67 changed files with 70 additions and 70 deletions.
2 changes: 1 addition & 1 deletion spec/barometer_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'

describe Barometer do
RSpec.describe Barometer do
describe ".config" do
around do |example|
cached_config = Barometer.config
Expand Down
2 changes: 1 addition & 1 deletion spec/base_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'

module Barometer
describe Base do
RSpec.describe Base do
let(:query) { build_query }
let(:barometer) { Base.new(query) }

Expand Down
2 changes: 1 addition & 1 deletion spec/data/attributes/distance_spec.rb
Expand Up @@ -7,7 +7,7 @@ class TestClass
attribute :distance, Data::Attribute::Distance
end

describe Data::Attribute::Distance do
RSpec.describe Data::Attribute::Distance do
let(:model) { TestClass.new }

context 'when setting to nil' do
Expand Down
2 changes: 1 addition & 1 deletion spec/data/attributes/location_spec.rb
Expand Up @@ -7,7 +7,7 @@ class TestClass
attribute :location, Data::Attribute::Location
end

describe Data::Attribute::Location do
RSpec.describe Data::Attribute::Location do
let(:model) { TestClass.new }

context 'when setting to nil' do
Expand Down
2 changes: 1 addition & 1 deletion spec/data/attributes/pressure_spec.rb
Expand Up @@ -7,7 +7,7 @@ class TestClass
attribute :pressure, Data::Attribute::Pressure
end

describe Data::Attribute::Pressure do
RSpec.describe Data::Attribute::Pressure do
let(:model) { TestClass.new }

context 'when setting to nil' do
Expand Down
2 changes: 1 addition & 1 deletion spec/data/attributes/sun_spec.rb
Expand Up @@ -7,7 +7,7 @@ class TestClass
attribute :sun, Data::Attribute::Sun
end

describe Data::Attribute::Sun do
RSpec.describe Data::Attribute::Sun do
let(:model) { TestClass.new }

context 'when setting to nil' do
Expand Down
2 changes: 1 addition & 1 deletion spec/data/attributes/temperature_spec.rb
Expand Up @@ -7,7 +7,7 @@ class TestClass
attribute :temperature, Data::Attribute::Temperature
end

describe Data::Attribute::Temperature do
RSpec.describe Data::Attribute::Temperature do
let(:model) { TestClass.new }

context 'when setting to nil' do
Expand Down
2 changes: 1 addition & 1 deletion spec/data/attributes/time_spec.rb
Expand Up @@ -7,7 +7,7 @@ class TestClass
attribute :time, Data::Attribute::Time
end

describe Data::Attribute::Time do
RSpec.describe Data::Attribute::Time do
let(:model) { TestClass.new }

context 'when nothing has been set' do
Expand Down
2 changes: 1 addition & 1 deletion spec/data/attributes/vector_spec.rb
Expand Up @@ -7,7 +7,7 @@ class TestClass
attribute :vector, Data::Attribute::Vector
end

describe Data::Attribute::Vector do
RSpec.describe Data::Attribute::Vector do
let(:model) { TestClass.new }

context 'when setting to nil' do
Expand Down
2 changes: 1 addition & 1 deletion spec/data/attributes/zone_spec.rb
Expand Up @@ -7,7 +7,7 @@ class TestClass
attribute :timezone, Data::Attribute::Zone
end

describe Data::Attribute::Zone do
RSpec.describe Data::Attribute::Zone do
let(:model) { TestClass.new }

context 'when nothing has been set' do
Expand Down
2 changes: 1 addition & 1 deletion spec/data/convertable_units_spec.rb
Expand Up @@ -13,7 +13,7 @@ def convert_metric_to_imperial(metric_value)
end
end

describe ConvertableUnits do
RSpec.describe ConvertableUnits do
describe '.initialize' do
it 'sets metric value' do
test_data = TestData.new(200.0, nil)
Expand Down
2 changes: 1 addition & 1 deletion spec/data/coordinates_spec.rb
@@ -1,7 +1,7 @@
require_relative '../spec_helper'

module Barometer::Data
describe Coordinates do
RSpec.describe Coordinates do
describe '#coordinates' do
it 'joins latitude and longitude' do
coordinates = Coordinates.new(
Expand Down
2 changes: 1 addition & 1 deletion spec/data/distance_spec.rb
@@ -1,7 +1,7 @@
require_relative '../spec_helper'

module Barometer::Data
describe Distance do
RSpec.describe Distance do
describe '.initialize' do
it 'sets km' do
distance = Distance.new(42.2, nil)
Expand Down
2 changes: 1 addition & 1 deletion spec/data/geo_spec.rb
@@ -1,7 +1,7 @@
require_relative '../spec_helper'

module Barometer::Data
describe Geo do
RSpec.describe Geo do
describe '#coordinates' do
it 'joins latitude and longitude' do
geo = Geo.new(
Expand Down
2 changes: 1 addition & 1 deletion spec/data/location_spec.rb
@@ -1,7 +1,7 @@
require_relative '../spec_helper'

module Barometer::Data
describe Location do
RSpec.describe Location do
describe '#coordinates' do
it 'joins longitude and latitude' do
location = Location.new(
Expand Down
2 changes: 1 addition & 1 deletion spec/data/pressure_spec.rb
@@ -1,7 +1,7 @@
require_relative '../spec_helper'

module Barometer::Data
describe Pressure do
RSpec.describe Pressure do
describe '.initialize' do
it 'sets mb' do
distance = Pressure.new(721.64, nil)
Expand Down
2 changes: 1 addition & 1 deletion spec/data/sun_spec.rb
@@ -1,7 +1,7 @@
require_relative '../spec_helper'

module Barometer::Data
describe Sun do
RSpec.describe Sun do
let(:local_time_set) { Time.now + (60*60*8) }
let(:local_time_rise) { Time.now }

Expand Down
2 changes: 1 addition & 1 deletion spec/data/temperature_spec.rb
@@ -1,7 +1,7 @@
require_relative '../spec_helper'

module Barometer::Data
describe Temperature do
RSpec.describe Temperature do
describe '.initialize' do
it 'sets C' do
temperature = Temperature.new(20.0, nil)
Expand Down
2 changes: 1 addition & 1 deletion spec/data/vector_spec.rb
@@ -1,7 +1,7 @@
require_relative '../spec_helper'

module Barometer::Data
describe Vector do
RSpec.describe Vector do
describe '.initialize' do
it 'sets kph' do
vector = Vector.new(16.09, nil, nil)
Expand Down
8 changes: 4 additions & 4 deletions spec/data/zone_spec.rb
@@ -1,7 +1,7 @@
require_relative '../spec_helper'

module Barometer::Data
describe Zone do
RSpec.describe Zone do
describe '#new' do
let(:zone) { double(:zone) }

Expand Down Expand Up @@ -37,7 +37,7 @@ module Barometer::Data
end
end

describe ZoneFull do
RSpec.describe ZoneFull do
def stub_time(utc_now)
now = double(:now, utc: utc_now)
double(:time_class, now: now)
Expand Down Expand Up @@ -135,7 +135,7 @@ def stub_time(utc_now)
end
end

describe ZoneOffset do
RSpec.describe ZoneOffset do
def stub_time(utc_now)
now = double(:now, utc: utc_now)
double(:time_class, now: now)
Expand Down Expand Up @@ -210,7 +210,7 @@ def stub_time(utc_now)
end
end

describe ZoneCode do
RSpec.describe ZoneCode do
def stub_time(utc_now)
now = double(:now, utc: utc_now)
double(:time_class, now: now)
Expand Down
2 changes: 1 addition & 1 deletion spec/query/base_spec.rb
@@ -1,7 +1,7 @@
require_relative '../spec_helper'

module Barometer
describe Query::Base do
RSpec.describe Query::Base do
describe '.initialize' do
describe 'detecting the query format' do
it 'detects :short_zipcode' do
Expand Down
2 changes: 1 addition & 1 deletion spec/query/converter_spec.rb
@@ -1,6 +1,6 @@
require_relative '../spec_helper'

describe Barometer::Query::Converter do
RSpec.describe Barometer::Query::Converter do
def clear_converters
@converters_cache = Barometer::Query::Converter.converters
Barometer::Query::Converter.converters = {}
Expand Down
Expand Up @@ -3,7 +3,7 @@
module Barometer
module Query
module Converter
describe FromCoordinatesToNoaaStationId, vcr: {
RSpec.describe FromCoordinatesToNoaaStationId, vcr: {
match_requests_on: [:method, :uri],
cassette_name: "Converter::FromCoordinatesToNoaaStationId"
} do
Expand Down
2 changes: 1 addition & 1 deletion spec/query/converters/from_geocode_to_coordinates_spec.rb
@@ -1,6 +1,6 @@
require_relative '../../spec_helper'

describe Barometer::Query::Converter::FromGeocodeToCoordinates do
RSpec.describe Barometer::Query::Converter::FromGeocodeToCoordinates do
it "converts :geocode -> :coordinates" do
query = Barometer::Query.new('USNY0996')
query.add_conversion(:geocode, 'New York, NY')
Expand Down
@@ -1,6 +1,6 @@
require_relative '../../spec_helper'

describe Barometer::Query::Converter::FromShortZipcodeToZipcode do
RSpec.describe Barometer::Query::Converter::FromShortZipcodeToZipcode do
it "converts :short_zipcode -> :zipcode" do
query = Barometer::Query.new('90210')

Expand Down
2 changes: 1 addition & 1 deletion spec/query/converters/from_weather_id_to_geocode_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Converter::FromWeatherIdToGeocode, vcr: {
RSpec.describe Converter::FromWeatherIdToGeocode, vcr: {
match_requests_on: [:method, :uri],
cassette_name: 'Converter::FromWeatherIdToGeocode'
} do
Expand Down
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Converter::FromWoeIdOrIpv4ToGeocode, vcr: {
RSpec.describe Converter::FromWoeIdOrIpv4ToGeocode, vcr: {
match_requests_on: [:method, :uri],
cassette_name: 'Converter::FromWoeIdOrIpv4ToGeocode'
} do
Expand Down
2 changes: 1 addition & 1 deletion spec/query/converters/to_geocode_spec.rb
@@ -1,6 +1,6 @@
require_relative '../../spec_helper'

describe Barometer::Query::Converter::ToGeocode, vcr: {
RSpec.describe Barometer::Query::Converter::ToGeocode, vcr: {
match_requests_on: [:method, :uri],
cassette_name: "Converter::ToGeocode"
} do
Expand Down
2 changes: 1 addition & 1 deletion spec/query/converters/to_weather_id_spec.rb
@@ -1,6 +1,6 @@
require_relative '../../spec_helper'

describe Barometer::Query::Converter::ToWeatherId, vcr: {
RSpec.describe Barometer::Query::Converter::ToWeatherId, vcr: {
match_requests_on: [:method, :uri],
cassette_name: "Converter::ToWeatherId"
} do
Expand Down
2 changes: 1 addition & 1 deletion spec/query/converters/to_woe_id_spec.rb
@@ -1,6 +1,6 @@
require_relative '../../spec_helper'

describe Barometer::Query::Converter::ToWoeId, vcr: {
RSpec.describe Barometer::Query::Converter::ToWoeId, vcr: {
cassette_name: 'Converter::ToWoeId'
} do

Expand Down
2 changes: 1 addition & 1 deletion spec/query/formats/base_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Format::Base do
RSpec.describe Format::Base do
describe '.is?' do
it 'raises an error by default' do
expect { Format::Base.is?('valid') }.to raise_error(NotImplementedError)
Expand Down
2 changes: 1 addition & 1 deletion spec/query/formats/coordinates_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Format::Coordinates do
RSpec.describe Format::Coordinates do
describe '.geo' do
specify { expect( Format::Coordinates.geo(nil) ).to be_nil }

Expand Down
2 changes: 1 addition & 1 deletion spec/query/formats/geocode_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Format::Geocode do
RSpec.describe Format::Geocode do
describe '.is?' do
it 'returns false' do
expect( Format::Geocode.is?('New York, NY') ).to be false
Expand Down
2 changes: 1 addition & 1 deletion spec/query/formats/icao_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Format::Icao do
RSpec.describe Format::Icao do
describe '.geo' do
specify { expect( Format::Icao.geo(nil) ).to be_nil }
specify { expect( Format::Icao.geo('KSFO') ).to eq({country_code: 'US'}) }
Expand Down
2 changes: 1 addition & 1 deletion spec/query/formats/ipv4_address_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Format::Ipv4Address do
RSpec.describe Format::Ipv4Address do
describe '.is?' do
describe 'when the query is an IPv4 address' do
specify { expect( Format::Ipv4Address.is?('8.8.8.8') ).to be true }
Expand Down
2 changes: 1 addition & 1 deletion spec/query/formats/noaa_station_id_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Format::NoaaStationId do
RSpec.describe Format::NoaaStationId do
describe '.is?' do
it 'returns false' do
expect( Format::NoaaStationId.is?('') ).to be false
Expand Down
2 changes: 1 addition & 1 deletion spec/query/formats/postalcode_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Format::Postalcode do
RSpec.describe Format::Postalcode do
describe '.geo' do
specify { expect( Format::Postalcode.geo(nil) ).to eq({country_code: 'CA'}) }
specify { expect( Format::Postalcode.geo('ignored') ).to eq({country_code: 'CA'}) }
Expand Down
2 changes: 1 addition & 1 deletion spec/query/formats/short_zipcode_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Format::ShortZipcode do
RSpec.describe Format::ShortZipcode do
describe '.geo' do
specify { expect( Format::ShortZipcode.geo(nil) ).to eq({country_code: 'US'}) }
specify { expect( Format::ShortZipcode.geo('ignored') ).to eq({country_code: 'US'}) }
Expand Down
2 changes: 1 addition & 1 deletion spec/query/formats/unknown_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Format::Unknown do
RSpec.describe Format::Unknown do
describe '.is?' do
it 'returns true' do
expect( Format::Unknown.is?('New York, NY') ).to be true
Expand Down
2 changes: 1 addition & 1 deletion spec/query/formats/weather_id_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Format::WeatherID do
RSpec.describe Format::WeatherID do
describe '.geo' do
specify { expect( Format::WeatherID.geo(nil) ).to be_nil }
specify { expect( Format::WeatherID.geo('i') ).to be_nil }
Expand Down
2 changes: 1 addition & 1 deletion spec/query/formats/woe_id_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Format::WoeID do
RSpec.describe Format::WoeID do
describe '.is?' do
it 'recognizes a valid 4 digit code format' do
expect( Format::WoeID.is?('8775') ).to be true
Expand Down
2 changes: 1 addition & 1 deletion spec/query/formats/zipcode_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

module Barometer::Query
describe Format::Zipcode do
RSpec.describe Format::Zipcode do
describe '.geo' do
specify { expect( Format::Zipcode.geo(nil) ).to eq({country_code: 'US'}) }
specify { expect( Format::Zipcode.geo('ignored') ).to eq({country_code: 'US'}) }
Expand Down

0 comments on commit 5b6975e

Please sign in to comment.