Sha256: f42a7471f4db5be4f216762d574d7acf2f825fab179ab227df0c7e74b6e46ecd

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

require File.join(File.dirname(__FILE__), 'spec_helper')

describe Blueprints do
  it "should build cherry blueprint" do
    build :cherry
    @cherry.should_not be_nil
    @cherry.should be_instance_of(Fruit)
    @cherry.species.should == 'cherry'
  end

  it "should not build cherry if not asked" do
    @cherry.should == nil
  end

  describe "prebuilt blueprints" do
    it "big cherry should have size of 10 even if it was changed in test below" do
      @big_cherry.size.should == 10
      @big_cherry.size = 15
    end

    it "big cherry should have size of 10 even if it was changed in test above" do
      @big_cherry.size.should == 10
      @big_cherry.size = 13
    end
  end

  describe "build per describe" do
    build_blueprint :cherry

    it "should have cherry" do
      @cherry.should_not be_nil
    end

    it "should have correct cherry species" do
      @cherry.species.should == 'cherry'
    end
  end

  it "should allow shortened forms of blueprint for any type of object" do
    build :apple
    @apple.should_not be_nil
    @apple.species.should == 'apple'
    @apple.size.should == 3
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blueprints-0.8.2 spec/no_db/blueprints_spec.rb
blueprints-0.8.1 spec/no_db/blueprints_spec.rb
blueprints-0.8.0 spec/no_db/blueprints_spec.rb