Sha256: dfa27d2d7d1964eb5265ccf571955472f6a951bd5143ac87c0fe948811024504

Contents?: true

Size: 507 Bytes

Versions: 3

Compression:

Stored size: 507 Bytes

Contents

require 'rspec'
module Qrb
  describe System, "[]" do

    let(:system){ System.new }

    before do
      system.add_type(intType)
    end

    subject{ system[name] }

    context 'with an existing type name' do
      let(:name){ "intType" }

      it 'should return the type' do
        subject.should eq(intType)
      end
    end

    context 'with a non existing type name' do
      let(:name){ "noSuchOne" }

      it 'should return nil' do
        subject.should be_nil
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
qrb-0.3.0 spec/unit/system/test_get_type.rb
qrb-0.2.0 spec/unit/system/test_get_type.rb
qrb-0.1.0 spec/unit/system/test_get_type.rb