Sha256: e75ca673fc36614954fd9043e35804d8869868ccdfbfd0d7db48502a90a596c2

Contents?: true

Size: 626 Bytes

Versions: 3

Compression:

Stored size: 626 Bytes

Contents

describe NetworkExecutive::ChannelSchedule do

  before do
    Timecop.freeze Time.now.change hour:12, min:0, sec:0
  end

  subject do
    schedule = double('schedule')

    schedule.stub(:include?).and_return false, true, false

    described_class.new [ schedule, schedule, schedule ]
  end

  describe '#add' do
    before { subject.add( 'foo' ) }

    it 'should prefix the collection' do
      subject.first.should == 'foo'
    end
  end

  describe '#find_by_showtime' do
    it 'should check if the schedule includes the given time' do
      subject.find_by_showtime( Time.now ).should == subject[1]
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
network_executive-0.0.4 spec/models/channel_schedule_spec.rb
network_executive-0.0.3 spec/models/channel_schedule_spec.rb
network_executive-0.0.2 spec/models/channel_schedule_spec.rb