Permalink
Browse files

remove specs for removed methods

  • Loading branch information...
1 parent 9b059b7 commit 5936d070dace80547d598808b57d3fb5d2154d56 @jnicklas committed Apr 24, 2012
Showing with 1 addition and 45 deletions.
  1. +1 −45 spec/step_definition_spec.rb
@@ -1,50 +1,6 @@
describe Turnip::StepDefinition do
let(:all_steps) { [] }
- describe ".find" do
- it "returns a step definition that matches the description" do
- all_steps << Turnip::StepDefinition.new("there are :count monsters")
- Turnip::StepDefinition.find(all_steps, "there are 23 monsters").expression.should eq("there are :count monsters")
- end
-
- it "raises an error if the match is ambiguous" do
- all_steps << Turnip::StepDefinition.new("there are :count monsters")
- all_steps << Turnip::StepDefinition.new("there are 23 monsters")
- expect { Turnip::StepDefinition.find(all_steps, "there are 23 monsters") }.to raise_error(Turnip::StepDefinition::Ambiguous)
- end
-
- it "raises an error if there is no match" do
- expect { Turnip::StepDefinition.find(all_steps, "there are 23 monsters") }.to raise_error(Turnip::StepDefinition::Pending)
- end
- end
-
- describe ".execute" do
- let(:context) { stub }
-
- it "executes a step in the given context" do
- all_steps << Turnip::StepDefinition.new("there are :count monsters") { @testing = 123 }
- Turnip::StepDefinition.execute(context, all_steps, stub(:description => "there are 23 monsters", :extra_arg => nil))
- context.instance_variable_get(:@testing).should == 123
- end
-
- it "tells the context that the step is pending" do
- context.should_receive(:pending).with("the step 'there are 23 monsters' is not implemented")
- Turnip::StepDefinition.execute(context, all_steps, stub(:description => "there are 23 monsters", :extra_arg => nil))
- end
-
- it "sends along arguments" do
- all_steps << Turnip::StepDefinition.new("there are :count monsters") { |count| @testing = count.to_i }
- Turnip::StepDefinition.execute(context, all_steps, stub(:description => "there are 23 monsters", :extra_arg => nil))
- context.instance_variable_get(:@testing).should == 23
- end
-
- it "sends along extra arguments" do
- all_steps << Turnip::StepDefinition.new("there are :count monsters") { |count, extra| @testing = extra }
- Turnip::StepDefinition.execute(context, all_steps, stub(:description => "there are 23 monsters", :extra_arg => 'foo'))
- context.instance_variable_get(:@testing).should == 'foo'
- end
- end
-
describe "#match" do
it "matches a simple step" do
step = Turnip::StepDefinition.new("there are monsters") {}
@@ -60,7 +16,7 @@
step.should match("there are 324 monsters")
step.should_not match("there are no monsters")
end
-
+
it "matches quoted placeholders" do
step = Turnip::StepDefinition.new("there is a monster named :name") {}
step.should match("there is a monster named 'Scary'")

0 comments on commit 5936d07

Please sign in to comment.