hrt_bus 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -4,7 +4,7 @@ Ruby gem for public HRT bus location data
4
4
 
5
5
  ### Installation
6
6
 
7
- gem intall hrt_bus
7
+ gem install hrt_bus
8
8
 
9
9
  ### A collection of HRT buses as Ruby ActiveModel objects
10
10
 
data/lib/hrt_bus/bus.rb CHANGED
@@ -11,7 +11,7 @@ module HrtBus
11
11
  validates_numericality_of :lat, greater_than: 0
12
12
  validates_numericality_of :lon, less_than: 0
13
13
 
14
- validates :time, :lat, :lon, :route_id, :presence => true
14
+ validates :id, :time, :lat, :lon, :route_id, :presence => true
15
15
 
16
16
  def initialize(attributes={})
17
17
  self.attributes = attributes
@@ -1,3 +1,3 @@
1
1
  module HrtBus
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -2,6 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  FactoryGirl.define do
4
4
  factory :bus, :class => HrtBus::Bus do
5
+ id { SecureRandom.random_number(1e9.to_i) }
5
6
  time { Time.now }
6
7
  lat { 36.8642501 }
7
8
  lon { -76.2818951 }
@@ -6,6 +6,13 @@ describe HrtBus::Bus do
6
6
 
7
7
  let(:bus) { Factory.build(:bus) }
8
8
 
9
+ it "should validate_presence_of :id" do
10
+ bus.should be_valid
11
+ bus.id = nil
12
+ bus.should_not be_valid
13
+ bus.errors.messages[:id].first.should match(/can't be blank/)
14
+ end
15
+
9
16
  it "should validate_presence_of :time" do
10
17
  bus.should be_valid
11
18
  bus.time = nil
@@ -1,11 +1,8 @@
1
1
  require 'vcr'
2
2
 
3
- uri_without_auth_token = VCR.request_matchers.uri_without_param(:auth_token)
4
-
5
3
  VCR.configure do |c|
6
4
  c.cassette_library_dir = 'vcr_cassettes'
7
5
  c.hook_into :webmock
8
- c.default_cassette_options = { :match_requests_on => [:method, uri_without_auth_token] }
9
6
  end
10
7
 
11
8
  RSpec.configure do |c|
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: hrt_bus
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Brian Douglas Smith
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-03-02 00:00:00 Z
13
+ date: 2012-03-03 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activemodel
@@ -168,7 +168,6 @@ files:
168
168
  - lib/hrt_bus/config.rb
169
169
  - lib/hrt_bus/parse.rb
170
170
  - lib/hrt_bus/version.rb
171
- - spec/bus_spec.rb
172
171
  - spec/factories/bus.rb
173
172
  - spec/models/bus_attributes_spec.rb
174
173
  - spec/models/bus_methods_spec.rb
@@ -205,7 +204,6 @@ signing_key:
205
204
  specification_version: 3
206
205
  summary: Ruby gem for public HRT bus location data
207
206
  test_files:
208
- - spec/bus_spec.rb
209
207
  - spec/factories/bus.rb
210
208
  - spec/models/bus_attributes_spec.rb
211
209
  - spec/models/bus_methods_spec.rb
data/spec/bus_spec.rb DELETED
File without changes