Sha256: 5b64d219d70e955b83e77abebf074a608dd2562f41ae0a7344684f33b9d67f51
Contents?: true
Size: 941 Bytes
Versions: 1
Compression:
Stored size: 941 Bytes
Contents
# encoding: UTF-8 require 'spec_helper' require 'support/account' require 'wakatime' require 'webmock/rspec' describe Wakatime::Client do before do @session = Wakatime::Session.new end describe '#summary' do it 'should return json' do stub_request(:get, "#{Wakatime::API_URL}/summary") .with(query: hash_including(:start, :end)) .to_return(body: File.read('./spec/fixtures/summary.json'), status: 200) client = Wakatime::Client.new(@session) expect(client.summary.grand_total.total_seconds).to eq 49_740 end end describe '#actions' do it 'should return json' do stub_request(:get, "#{Wakatime::API_URL}/actions") .with(query: hash_including(:start, :end)) .to_return(body: File.read('./spec/fixtures/actions.json'), status: 200) client = Wakatime::Client.new(@session) expect(client.actions.last.time).to eq 1_422_631_940.699831 end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
wakatime-0.0.2 | spec/client_spec.rb |