test/test_bikes.rb in bikes-0.0.2 vs test/test_bikes.rb in bikes-0.0.3
- old
+ new
@@ -16,39 +16,39 @@
def test_contracts
stub_request(:get, CONTRACTS_URL).with(query: { apiKey: API_KEY}).to_return({body: @contracts.read})
b = @bikes.contracts
- b.size.must_equal 4
+ _(b.size).must_equal 4
- b[1].name.must_equal 'Dublin'
- b[1].cities[0].must_equal 'Dublin'
- b[1].country_code.must_equal 'IE'
- b[1].commercial_name.must_equal 'dublinbikes'
+ _(b[1].name).must_equal 'Dublin'
+ _(b[1].cities[0]).must_equal 'Dublin'
+ _(b[1].country_code).must_equal 'IE'
+ _(b[1].commercial_name).must_equal 'dublinbikes'
end
def test_stations
stub_request(:get, STATIONS_URL).with(query: { apiKey: API_KEY, contract: 'Dublin'}).to_return({body: @stations.read})
s = @bikes.stations
- s.size.must_equal 3
- s[2].number.must_equal 32
- s[2].name.must_equal "PEARSE STREET"
- s[2].address.must_equal "Pearse Street"
- s[2].bike_stands.must_equal 30
- s[2].available_bike_stands.must_equal 2
- s[2].available_bikes.must_equal 27
+ _(s.size).must_equal 3
+ _(s[2].number).must_equal 32
+ _(s[2].name).must_equal "PEARSE STREET"
+ _(s[2].address).must_equal "Pearse Street"
+ _(s[2].bike_stands).must_equal 30
+ _(s[2].available_bike_stands).must_equal 2
+ _(s[2].available_bikes).must_equal 27
end
def test_station
snum = 32
stub_request(:get, STATIONS_URL + "/#{snum}").with(query: { apiKey: API_KEY, contract: 'Dublin'}).to_return({body: @station32.read})
s = @bikes.station(snum)
- s.wont_be_nil
- s.number.must_equal snum
+ _(s).wont_be_nil
+ _(s.number).must_equal snum
end
def test_bad_thing_happen
# This test to be written. Mock errors come from the API.
# response code is 400 and { "error" : "Please provide contract query parameter" }