Sha256: 035e575d3ed38efb7546713e49b9502e306f61af4f0d88e18371ece5f98831cc

Contents?: true

Size: 1.37 KB

Versions: 4

Compression:

Stored size: 1.37 KB

Contents

# -*- encoding : utf-8 -*-

describe Card::Set::All::Initialize do
  describe "new" do
    it "handles explicit nil as parameters" do
      c = Card.new nil
      c.should be_instance_of(Card)
      c.name.should == ''
    end

    it "handles nil name" do
      c = Card.new :name => nil
      c.should be_instance_of(Card)
      c.name.should == ''
    end
    
    it 'handles legit name' do
      c = Card.new :name => 'Ceee'
      c.should be_instance_of(Card)
      c.name.should == 'Ceee'
    end    
  end
  
  
  describe "module inclusion" do
    context '(search)' do
      before do
        @c = Card.new :type=>'Search', :name=>'Module Inclusion Test Card'
      end

      it "happens after new" do
        @c.respond_to?( :get_spec ).should be_true
      end

      it "happens after save" do
        @c.respond_to?( :get_spec ).should be_true
        @c.save!
        @c.respond_to?( :get_spec ).should be_true
      end

      it "happens after fetch" do
        @c.save!
        c = Card.fetch(@c.name)
        c.respond_to?( :get_spec ).should be_true
      end
    end

    context '(pointer)' do
      it "happens with explicit pointer setting" do
        Card.new(:type=>'Pointer').respond_to?(:add_item).should be_true
      end

      it "happens with implicit pointer setting (from template)" do
        Card.new(:name=>'Home+*watchers').should be_true
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wagn-1.13.0 spec/mod/core/set/all/initialize_spec.rb
wagn-1.13.0.pre2 spec/mods/core/sets/all/initialize_spec.rb
wagn-1.13.0.pre1 spec/mods/core/sets/all/initialize_spec.rb
wagn-1.13.0.pre spec/mods/core/sets/all/initialize_spec.rb