Sha256: febea63106346a876a172e24d7e42fb18df9c59c66ad8dbd3757c97776652ca7
Contents?: true
Size: 1.69 KB
Versions: 31
Compression:
Stored size: 1.69 KB
Contents
require 'spec_helper' require 'flydata/helper/action_ownership' module Flydata module Helper describe ActionOwnership do describe '#initialize' do let(:action_name) { 'stop_agent' } let(:action_class) { Action::StopAgent } subject { described_class.new(action_name, true, action_class) } it { expect(subject.action_name).to eq(action_name) } it { expect(subject.resource_change).to eq(true) } it { expect(subject.action_class).to eq(action_class) } it { expect(subject.owner).to eq(nil) } it { expect(subject.last_processed_time).to eq(-1) } end describe '#processing?' do let(:action_name) { 'stop_agent' } let(:action_class) { Action::StopAgent } let(:ownership) { described_class.new(action_name, true, action_class) } subject { ownership.processing? } context 'when owner is not set' do it { expect(subject).to be(false) } end context 'when owner is set' do before { ownership.owner = 'test-owner' } it { expect(subject).to be(true) } end end describe '.action_ownership_map' do subject { described_class.action_ownership_map } it do expect(subject.size).to eq(6) expect(subject.include?(:check_remote_actions)).to be(true) expect(subject.include?(:check_abnormal_shutdown)).to be(true) expect(subject.include?(:send_logs)).to be(true) expect(subject.include?(:stop_agent)).to be(true) expect(subject.include?(:restart_agent)).to be(true) expect(subject.include?(:update_helper_config)).to be(true) end end end end end
Version data entries
31 entries across 31 versions & 1 rubygems