Permalink
Browse files

add pending tests

  • Loading branch information...
1 parent 60d94f1 commit 3f1f848c79c9b26ae6881b834795c03359764983 @hone committed Sep 20, 2010
Showing with 38 additions and 1 deletion.
  1. +38 −1 spec/rtomayko_spec.rb
View
@@ -9,12 +9,15 @@
describe "normal spec" do
it { true.should be_false }
it { true.should be_false }
+ it "true == false", :pending => true do
+ true.should be_false
+ end
end
EOF
output = run_spec(spec)
- output.should =~ /2 examples, 2 failure/
+ output.should =~ /3 examples, 2 failures, 1 pending/
end
context "with RTomayko" do
@@ -45,5 +48,39 @@
execution_time = md[1].to_f
execution_time.to_f.should < 1
end
+
+ context "with pending tests" do
+ it "should mark pending tests as pending when before failed test" do
+ spec << <<EOF
+ describe "skip spec", :type => :rtomayko do
+ it "true == false", :pending => true do
+ true.should be_false
+ end
+ it { true.should be_false }
+ it { sleep(1);true.should be_false }
+ end
+EOF
+
+ output = run_spec(spec)
+
+ output.should =~ /3 examples, 1 failure, 1 pending, 1 skipped/
+ end
+
+ it "should mark pending tests as skipped after failed test" do
+ spec << <<EOF
+ describe "skip spec", :type => :rtomayko do
+ it { true.should be_false }
+ it { sleep(1);true.should be_false }
+ it "true == false", :pending => true do
+ true.should be_false
+ end
+ end
+EOF
+
+ output = run_spec(spec)
+
+ output.should =~ /3 examples, 1 failure, 2 skipped/
+ end
+ end
end
end

0 comments on commit 3f1f848

Please sign in to comment.