Sha256: afc5138448512055ef9cba1a931dc9e54a991ae782369b7be044faa5b85f92a1

Contents?: true

Size: 632 Bytes

Versions: 8

Compression:

Stored size: 632 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
      API.stub(:new).with(api_key, {}).and_return(api)
    end

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

      schedule.run(time, num)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
td-client-0.8.79 spec/td/client/model_schedule_spec.rb
td-client-0.8.78 spec/td/client/model_schedule_spec.rb
td-client-0.9.0dev2 spec/td/client/model_schedule_spec.rb
td-client-0.9.0dev1 spec/td/client/model_schedule_spec.rb
td-client-0.8.77 spec/td/client/model_schedule_spec.rb
td-client-0.8.76 spec/td/client/model_schedule_spec.rb
td-client-0.8.75 spec/td/client/model_schedule_spec.rb
td-client-0.8.74 spec/td/client/model_schedule_spec.rb