Sha256: 0c027996c5b11907592c225fd94edb8d1692249bd3ad9eec39a934460bb2928b

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

$: << File.dirname(__FILE__) + "/bin"
$: << File.dirname(__FILE__) + "/../lib"

require "caricature"
require 'bacon'
require 'mscorlib'




load_assembly 'ClrModels'

class Soldier

  def initialize
    @life = 10
  end

  def name
    "Tommy Boy"
  end

  def to_s
    "I'm a soldier"
  end

  def attack(target, weapon)
    weapon.attack(target)
  end

  def is_killed_by?(weapon)
    weapon.damage > 3
  end

  def survive_attack_with(weapon)
    @life - weapon.damage
  end

end

class Dagger

  def damage
    2
  end

  def attack(target)
    target.survive_attack_with self  
  end


end

module Caricature

  module InterfaceIncludingModule
    include ClrModels::IWarrior
  end

  module PureRubyModule
    
  end

  module RubyModuleIncludingModule
    include PureRubyModule
  end

  module InterfaceUpTheWazoo
    include InterfaceIncludingModule
  end

  class InterfaceIncludingClass
    include ClrModels::IWarrior
  end

  class SubClassingClrClass < ClrModels::Ninja

  end

  class InterfaceUpTheWazooClass
    include InterfaceUpTheWazoo
  end

  class SubclassingRubyClass < Soldier

  end

  class ModuleIncludingClass
    include RubyModuleIncludingModule
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
casualjim-caricature-0.3.1 spec/bacon_helper.rb
caricature-0.3.1 spec/bacon_helper.rb