Sha256: d3980f44fb55b8d175b48d4bfffe4d70d8191c8556e5370892a2a8e4760e8bc4

Contents?: true

Size: 1.81 KB

Versions: 3

Compression:

Stored size: 1.81 KB

Contents

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

describe Card::Set::All::Base do

  describe 'handles view' do
  
    it("name"    ) { render_card(:name).should      == 'Tempo Rary' }
    it("key"     ) { render_card(:key).should       == 'tempo_rary' }
    it("linkname") { render_card(:linkname).should  == 'Tempo_Rary' }

    it "url" do
      Card::Env[:protocol] = 'http://'
      Card::Env[:host]     = 'eric.skippy.com'
      render_card(:url).should == 'http://eric.skippy.com/Tempo_Rary'
    end

    it :raw do
      @a = Card.new :content=>"{{A}}"
      @a.format._render(:raw).should == "{{A}}"
    end

    it "core" do
      render_card(:core, :name=>'A+B').should == "AlphaBeta"
    end
    
    it 'core for new card' do
      Card.new.format._render_core.should == ''
    end
  
    describe 'array' do
      it "of search items" do
        Card.create! :name => "n+a", :type=>"Number", :content=>"10"
        Card.create! :name => "n+b", :type=>"Phrase", :content=>"say:\"what\""
        Card.create! :name => "n+c", :type=>"Number", :content=>"30"
        c = Card.new :name => 'nplusarray', :content => "{{n+*children+by create|array}}"
        c.format._render( :core ).should == %{["10", "say:\\"what\\"", "30"]}
      end

      it "of pointer items" do
        Card.create! :name => "n+a", :type=>"Number", :content=>"10"
        Card.create! :name => "n+b", :type=>"Number", :content=>"20"
        Card.create! :name => "n+c", :type=>"Number", :content=>"30"
        Card.create! :name => "npoint", :type=>"Pointer", :content => "[[n+a]]\n[[n+b]]\n[[n+c]]"
        c = Card.new :name => 'npointArray', :content => "{{npoint|array}}"
        c.format._render( :core ).should == %q{["10", "20", "30"]}
      end
      
      it "of basic items" do
        render_card(:array, :content=>'yoing').should==%{["yoing"]}
      end
    end
 
  end 
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wagn-1.13.0 spec/mod/standard/set/all/base_spec.rb
wagn-1.13.0.pre2 spec/mods/standard/sets/all/base_spec.rb
wagn-1.13.0.pre1 spec/mods/standard/sets/all/base_spec.rb