hrt_bus 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/hrt_bus/bus.rb +1 -1
- data/lib/hrt_bus/version.rb +1 -1
- data/spec/factories/bus.rb +1 -0
- data/spec/models/bus_validations_spec.rb +7 -0
- data/spec/support/vcr_setup.rb +0 -3
- metadata +2 -4
- data/spec/bus_spec.rb +0 -0
data/README.md
CHANGED
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
|
data/lib/hrt_bus/version.rb
CHANGED
data/spec/factories/bus.rb
CHANGED
@@ -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
|
data/spec/support/vcr_setup.rb
CHANGED
@@ -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.
|
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-
|
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
|