Sha256: 6320b9159293ac147ca8827c39f9e59c50ca7a97122c7707d7bc9279eddb419e

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe SPNet::Block do
  context '.new' do
    context 'no I/O ports given' do
      before :all do
        @block = SPNet::Block.new
      end
      
      it 'should have no input ports' do
        @block.signal_in_ports.should be_empty
      end

      it 'should have no output ports' do
        @block.signal_out_ports.should be_empty
      end
    end
    
    context '1 signal in and 1 signal out port given' do
      before :all do
        @block = SPNet::Block.new(
          :signal_in_ports => [SPNet::SignalInPort.new(:name => "IN")],
          :signal_out_ports => [SPNet::SignalOutPort.new(:name => "OUT")],
        )
      end
      
      it 'should have no input ports' do
        @block.signal_in_ports.count.should be 1
        @block.signal_in_ports.first.name.should eq("IN")
      end

      it 'should have no output ports' do
        @block.signal_out_ports.count.should be 1
        @block.signal_out_ports.first.name.should eq("OUT")
      end      
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spnet-0.1.2 spec/block_spec.rb
spnet-0.1.1 spec/block_spec.rb
spnet-0.1.0 spec/block_spec.rb