Sha256: 1ff7e6c58b189f6f77e3d903f28ce1596e71ff43cdf5d7510e1dbb5a8e4a6e02

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 KB

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'

describe WorkflowKit::Brick do

  describe "Instance" do

    before { @boil_water_brick = WorkflowKit::BoilWaterBrick.new } # in spec/support/factory.rb
    subject { @boil_water_brick }
    
    it { should respond_to( :name ) }
    it { should respond_to( :description ) }
    
    describe "#execute" do
      it "should execute the brick" do
        @boil_water_brick.execute( :aim_temperature => "100 °C" ).should ==
          "Fill a large pot with water, put it on a cooker and wait until a temperature of 100 °C is reached."
      end
    end

  end

  describe "Class" do
    
    subject { WorkflowKit::Brick }

    describe ".all" do
      subject { WorkflowKit::Brick.all }
      it "should list all inherited classes, i.e. the different kind of WorkflowBricks" do
        (subject & [WorkflowKit::BoilWaterBrick, WorkflowKit::BoilSpaghettiBrick, WorkflowKit::ServeSpaghettiBrick] )
          .should == [WorkflowKit::BoilWaterBrick, WorkflowKit::BoilSpaghettiBrick, WorkflowKit::ServeSpaghettiBrick]
      end
    end

  end

end


Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
workflow_kit-0.0.8 spec/models/brick_spec.rb
workflow_kit-0.0.7 spec/models/brick_spec.rb
workflow_kit-0.0.6.alpha spec/models/brick_spec.rb
workflow_kit-0.0.4.alpha spec/models/brick_spec.rb
workflow_kit-0.0.3.alpha spec/models/brick_spec.rb
workflow_kit-0.0.2.alpha spec/models/brick_spec.rb