Sha256: 92dcc28f52d82f40a7df2c3ee93207ef085011480f4321064b0274938916fa87

Contents?: true

Size: 1.45 KB

Versions: 9

Compression:

Stored size: 1.45 KB

Contents

require 'pione/test-helper'

class VariableHolderA
  include Util::VariableHoldable
  include_variable true
end

class VariableHolderB
  include Util::VariableHoldable
  include_variable false
end

class VariableHolderC
  include Util::VariableHoldable
  hold_variable :a
  attr_accessor :a
end

class VariableHolderD
  include Util::VariableHoldable
  hold_variables :a, :b, :c
  attr_accessor :a
  attr_accessor :b
  attr_accessor :c
end

describe "Pione::Util::VariableHoldable" do
  describe "VariableHolderA" do
    it "should include variable" do
      VariableHolderA.new.should.include_variable
    end
  end

  describe "VariableHolderB" do
    it "should not include variable" do
      VariableHolderB.new.should.not.include_variable
    end
  end

  describe "VariableHolderC" do
    it "should include variable" do
      c = VariableHolderC.new
      c.a = VariableHolderA.new
      c.should.include_variable
    end

    it "should not include variable" do
      c = VariableHolderC.new
      c.should.not.include_variable
      c.a = VariableHolderB.new
      c.should.not.include_variable
    end
  end

  describe "VariableHolderD" do
    it "should include variable" do
      d = VariableHolderD.new
      d.a = VariableHolderA.new
      d.should.include_variable
    end

    it "should not include variable" do
      d = VariableHolderD.new
      d.should.not.include_variable
      d.a = VariableHolderB.new
      d.should.not.include_variable
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pione-0.5.0 test/util/spec_variable-holdable.rb
pione-0.5.0.alpha.2 test/util/spec_variable-holdable.rb
pione-0.5.0.alpha.1 test/util/spec_variable-holdable.rb
pione-0.4.2 test/util/spec_variable-holdable.rb
pione-0.4.1 test/util/spec_variable-holdable.rb
pione-0.4.0 test/util/spec_variable-holdable.rb
pione-0.3.2 test/util/spec_variable-holdable.rb
pione-0.3.1 test/util/spec_variable-holdable.rb
pione-0.3.0 test/util/spec_variable-holdable.rb