Sha256: 5bce9e93e102b262b9310fed74be81a2b9d9ab63e4141477e8c117a6acfe0374

Contents?: true

Size: 1021 Bytes

Versions: 3

Compression:

Stored size: 1021 Bytes

Contents

require 'spec_helper'


describe Velibe::StationStatus do

  describe '#new' do

    context 'Can create Status with proper values' do

      let(:status) { Velibe::StationStatus.new 'AB', available_bikes= 2, available_bike_stands=4 }

      it 'has proper name' do
        expect(status.name).to eq 'AB'
      end
      it 'has proper bike stand' do
        expect(status.available_bikes).to eq 2
      end
      it 'has proper bike' do
        expect(status.available_bike_stands).to eq 4
      end


    end

   describe 'from_hash' do

     context 'handle valid input values' do
        let(:data) { { name: 'station', available_bikes: 2, available_bike_stands:4 } }
        let(:status) { Velibe::StationStatus.from_hash(data) }
        it 'capitalize station name' do expect(status.name).to eq 'Station' end
        it { expect(status.available_bikes).to eq 2 }

     end

     context 'wrong input values'
     # TODO: define which error to grab

   end

  end

  describe 'Boolean status working' do

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
velibe-0.2.3 spec/station_status_spec.rb
velibe-0.2.2 spec/station_status_spec.rb
velibe-0.2.1 spec/station_status_spec.rb