describe Celsius::Transformation::Step do context "when initialized with a transformation" do let(:transformation) do Class.new(Celsius::Transformation) do def some_transformation_method true end end.new end let(:step) do described_class.new(transformation) end describe "#transformation" do it "allows access to the transformation" do expect(step.transformation).to be(transformation) end end context "if a unknown method is called" do context "if the transformation has a matching method" do it "calls the method on the transformation" do expect(step).to respond_to(:some_transformation_method) expect(step.some_transformation_method).to eq(transformation.some_transformation_method) end end context "if the transformation has no matching method" do it "raises an error" do expect { step.some_unknown_method }.to raise_error end end end end end