Sha256: a1fe321e2264ac0b604570a1cd49b574e3f39652b00154735e52f8fad070966c

Contents?: true

Size: 839 Bytes

Versions: 3

Compression:

Stored size: 839 Bytes

Contents

describe NetworkExecutive::Program do

  let(:klass) do
    Class.new described_class
  end

  before do
    stub_const 'MyProgram', klass
  end

  subject { MyProgram.new }

  its(:name) { should == 'my_program' }
  its(:url)  { should == '' }
  its(:play) { should == %q[{"name":"my_program","url":""}] }

  describe '#as_json' do
    subject { MyProgram.new.as_json }

    it { should include( name:'my_program' ) }
    it { should include( url: '' ) }
  end

  describe '.find_by_name' do
    it 'should find a program by name' do
      NetworkExecutive::Network.programming.should_receive( :find )

      described_class.find_by_name 'foo'
    end
  end

  describe '.inherited' do
    it 'should register the program with the Network' do
      NetworkExecutive::Network.programming.first.should be_a described_class
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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