Sha256: 4d0f8c1ac1e3e146cb6617ee621cb9d908f201119a1e94a82a15454321e80352

Contents?: true

Size: 845 Bytes

Versions: 31

Compression:

Stored size: 845 Bytes

Contents

require 'spec_helper'

describe Krikri::Activity do

  subject { described_class.new(agent_class.new) }
  let(:agent_class) { Class.new { extend Krikri::SoftwareAgent } }

  describe '#agent' do
    it 'has an agent' do
      expect(subject.agent).to be_a agent_class
    end
  end

  describe '#start_time' do
    before do
      subject.set_start_time
    end

    it 'marks start time' do
      expect(subject.start_time).to be_a DateTime
    end
  end

  describe 'end_time' do
    it 'raises an error if not started' do
      expect { subject.set_end_time }.to raise_error
    end

    context 'with start time' do
      before do
        subject.set_start_time
        subject.set_end_time
      end

      it 'marks end time' do
        subject.set_start_time
        expect(subject.end_time).to be_a DateTime
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
krikri-0.13.2 spec/models/activity_spec.rb~
krikri-0.13.1 spec/models/activity_spec.rb~
krikri-0.13.0 spec/models/activity_spec.rb~
krikri-0.12.4 spec/models/activity_spec.rb~
krikri-0.11.2 spec/models/activity_spec.rb~
krikri-0.11.1 spec/models/activity_spec.rb~
krikri-0.11.0 spec/models/activity_spec.rb~
krikri-0.10.1 spec/models/activity_spec.rb~
krikri-0.8.9 spec/models/activity_spec.rb~
krikri-0.8.8 spec/models/activity_spec.rb~
krikri-0.8.7 spec/models/activity_spec.rb~
krikri-0.8.6 spec/models/activity_spec.rb~
krikri-0.8.5 spec/models/activity_spec.rb~
krikri-0.8.4 spec/models/activity_spec.rb~
krikri-0.8.2 spec/models/activity_spec.rb~
krikri-0.8.0 spec/models/activity_spec.rb~
krikri-0.7.3 spec/models/activity_spec.rb~
krikri-0.7.2 spec/models/activity_spec.rb~
krikri-0.7.1 spec/models/activity_spec.rb~
krikri-0.6.0 spec/models/activity_spec.rb~