Sha256: c294964ae4f8b309401af6f9bca70434541048ae5b72b876adf2739ddc7393db

Contents?: true

Size: 649 Bytes

Versions: 17

Compression:

Stored size: 649 Bytes

Contents

require 'spec_helper'
require 'td/client/spec_resources'

describe 'Schedule Model' do
  describe '#run' do
    let(:api_key) { '1234567890abcd' }
    let(:api) { double(:api) }
    let(:client) { Client.new(api_key) }
    let(:name) { 'schedule' }
    let(:schedule) {
      Schedule.new(client, name, '0 0 * * * *', 'select 1')
    }
    let(:time) { "2013-01-01 00:00:00"  }
    let(:num) { 1 }

    before do
      allow(API).to receive(:new).with(api_key, {}).and_return(api)
    end

    it 'success call api' do
      expect(api).to receive(:run_schedule).with(name, time, num).and_return([])

      schedule.run(time, num)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
td-client-2.0.0 spec/td/client/model_schedule_spec.rb
td-client-1.0.8 spec/td/client/model_schedule_spec.rb
td-client-1.0.7 spec/td/client/model_schedule_spec.rb
td-client-1.0.6 spec/td/client/model_schedule_spec.rb
td-client-1.0.5 spec/td/client/model_schedule_spec.rb
td-client-1.0.4 spec/td/client/model_schedule_spec.rb
td-client-1.0.3 spec/td/client/model_schedule_spec.rb
td-client-1.0.2 spec/td/client/model_schedule_spec.rb
td-client-1.0.1 spec/td/client/model_schedule_spec.rb
td-client-1.0.0-java spec/td/client/model_schedule_spec.rb
td-client-1.0.0 spec/td/client/model_schedule_spec.rb
td-client-0.8.85 spec/td/client/model_schedule_spec.rb
td-client-0.8.84 spec/td/client/model_schedule_spec.rb
td-client-0.8.83 spec/td/client/model_schedule_spec.rb
td-client-0.8.82 spec/td/client/model_schedule_spec.rb
td-client-0.8.81 spec/td/client/model_schedule_spec.rb
td-client-0.8.80 spec/td/client/model_schedule_spec.rb