This repository has been archived by the owner on Jun 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from JPrevost/update_gems
Update gems and switch to expect syntax
- Loading branch information
Showing
19 changed files
with
110 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/usr/bin/env ruby | ||
begin | ||
load File.expand_path("../spring", __FILE__) | ||
rescue LoadError | ||
end | ||
APP_PATH = File.expand_path('../../config/application', __FILE__) | ||
require_relative '../config/boot' | ||
require 'rails/commands' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/usr/bin/env ruby | ||
begin | ||
load File.expand_path("../spring", __FILE__) | ||
rescue LoadError | ||
end | ||
require_relative '../config/boot' | ||
require 'rake' | ||
Rake.application.run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env ruby | ||
begin | ||
load File.expand_path("../spring", __FILE__) | ||
rescue LoadError | ||
end | ||
require 'bundler/setup' | ||
load Gem.bin_path('rspec-core', 'rspec') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# This file loads spring without using Bundler, in order to be fast | ||
# It gets overwritten when you run the `spring binstub` command | ||
|
||
unless defined?(Spring) | ||
require "rubygems" | ||
require "bundler" | ||
|
||
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m) | ||
ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) | ||
ENV["GEM_HOME"] = "" | ||
Gem.paths = ENV | ||
|
||
gem "spring", match[1] | ||
require "spring/binstub" | ||
end | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,56 @@ | ||
require 'spec_helper' | ||
|
||
describe Bustime, :vcr do | ||
|
||
it "should have access to the API key" do | ||
expect do | ||
ENV['CTA_API_KEY'].defined? | ||
end.to be_true | ||
end | ||
|
||
describe "busroutes" do | ||
describe 'busroutes' do | ||
before { @busroutes = Bustime.new.busroutes } | ||
|
||
it "should return an array (of hashes) of all busroutes" do | ||
@busroutes.kind_of?(Array).should be_true | ||
it 'returns an array (of hashes) of all busroutes' do | ||
expect(@busroutes.is_a?(Array)).to be true | ||
end | ||
|
||
it "should contain 147 Outer Drive Express" do | ||
@busroutes.select { |bus| bus["rt"] == "147" }.length().should equal 1 | ||
it 'contains 147 Outer Drive Express' do | ||
expect(@busroutes.select { |bus| bus['rt'] == '147' }.length).to eq(1) | ||
end | ||
|
||
end | ||
|
||
describe "busdirections" do | ||
describe 'busdirections' do | ||
before { @busdirections = Bustime.new.busdirections(147) } | ||
|
||
it "should return an array of hashes with directions for a particular route" do | ||
@busdirections.kind_of?(Array).should be_true | ||
it 'returns an array of hashes with directions for a particular route' do | ||
expect(@busdirections.is_a?(Array)).to be true | ||
end | ||
|
||
it "should return North Bound as one of the directions for the 147 route" do | ||
@busdirections.select { |dir| dir["dir"] == "Northbound"}.length().should equal 1 | ||
it 'returns North Bound as one of the directions for the 147 route' do | ||
expect(@busdirections.select { |dir| dir['dir'] == 'Northbound' } | ||
.length).to eq(1) | ||
end | ||
|
||
end | ||
|
||
describe "busstops" do | ||
describe 'busstops' do | ||
before { @busstops = Bustime.new.busstops(147, 'Northbound') } | ||
|
||
before { @busstops = Bustime.new.busstops(147,'Northbound') } | ||
|
||
it "should return an array of hashes of busstops for supplied route and direction" do | ||
@busstops.kind_of?(Array).should be_true | ||
it 'returns an array of hashes of busstops' do | ||
expect(@busstops.is_a?(Array)).to be true | ||
end | ||
|
||
it "should contain Michigan and Huron for 147 North Bound" do | ||
@busstops.select { |stpid| stpid["stpnm"] == "Michigan & Huron" }.length().should equal 1 | ||
it 'contains Michigan and Huron for 147 North Bound' do | ||
expect(@busstops.select { |stpid| stpid['stpnm'] == 'Michigan & Huron' } | ||
.length).to eq(1) | ||
end | ||
|
||
end | ||
|
||
describe "buspredictions" do | ||
before { @buspredictions = Bustime.new.buspredictions(147,'Northbound',1125) } | ||
|
||
it "should return an array of hashes with predictions for supplied route, direction and stopid" do | ||
@buspredictions.kind_of?(Array).should be_true | ||
describe 'buspredictions' do | ||
before do | ||
@buspredictions = Bustime.new.buspredictions(147, 'Northbound', 1125) | ||
end | ||
|
||
it "should contain the stopname in the predictions" do | ||
@buspredictions.select { |stpnm| stpnm["stpnm"] == "Michigan & Huron" }.length().should > 0 | ||
it 'returns an array of hashes with predictions' do | ||
expect(@buspredictions.is_a?(Array)).to be true | ||
end | ||
|
||
it 'contains the stopname in the predictions' do | ||
expect(@buspredictions.select { |s| s['stpnm'] == 'Michigan & Huron' } | ||
.length).to be > 0 | ||
end | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters