Sha256: f0028a320e14a00b0ca7e3e9b098e0a6ac062df4b9e570dc1c17402127b7514f

Contents?: true

Size: 1.4 KB

Versions: 7

Compression:

Stored size: 1.4 KB

Contents

# -*- encoding : utf-8 -*-
require 'wagn/spec_helper'

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

7 entries across 7 versions & 1 rubygems

Version Path
wagn-1.12.13 spec/mods/core/sets/all/initialize_spec.rb
wagn-1.12.12 spec/mods/core/sets/all/initialize_spec.rb
wagn-1.12.11 spec/mods/core/sets/all/initialize_spec.rb
wagn-1.12.10 spec/mods/core/sets/all/initialize_spec.rb
wagn-1.12.9 spec/mods/core/sets/all/initialize_spec.rb
wagn-1.12.8 spec/mods/core/sets/all/initialize_spec.rb
wagn-1.12.7 spec/mods/core/sets/all/initialize_spec.rb