Sha256: 545d3e24ee609fc3d15a25538ae318cd1a6b9ed287b61500ffc2fd1ca426c3e1

Contents?: true

Size: 1.07 KB

Versions: 10

Compression:

Stored size: 1.07 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe "Object" do
  it "should respond to to_os" do
    Object.new.respond_to?(:to_os).should == true
  end
  describe "with_options" do
    before(:each) do
      @obj = Class.new
    end
    it "should respond to with_options" do
      @obj.respond_to?(:with_options).should == true
    end
    it "should set the options on the parent" do
      allow_message_expectations_on_nil
      @a.should_receive(:clone).and_return @a
      @a.stub!(:options).and_return({})
      with_options({:nick => "name"}, @a) do
      end
    end
    
    describe "running" do
      before(:each) do
        Class.stub!(:default_options).and_return({})
        Class.send :include, Configurable
        Class.send :include, MethodMissingSugar
        @a = Class.new        
        @b = Class.new
        
        with_options({:nick => "name", :b => @b}, @a) do
          b.dude "totally"
        end
        
      end
      it "should set the options on the child in the instance eval" do
        @b.dude.should == "totally"
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
auser-poolparty-0.2.15 spec/poolparty/core/object_spec.rb
auser-poolparty-0.2.16 spec/poolparty/core/object_spec.rb
auser-poolparty-0.2.3 spec/poolparty/core/object_spec.rb
auser-poolparty-0.2.4 spec/poolparty/core/object_spec.rb
auser-poolparty-0.2.5 spec/poolparty/core/object_spec.rb
auser-poolparty-0.2.6 spec/poolparty/core/object_spec.rb
auser-poolparty-0.2.8 spec/poolparty/core/object_spec.rb
auser-poolparty-0.2.9 spec/poolparty/core/object_spec.rb
poolparty-0.2.6 spec/poolparty/core/object_spec.rb
poolparty-0.2.18 spec/poolparty/core/object_spec.rb