spec/testrbl_spec.rb in testrbl-0.1.2 vs spec/testrbl_spec.rb in testrbl-0.1.3
- old
+ new
@@ -75,10 +75,39 @@
result.should include "ABC"
result.should_not include "BCD"
end
end
+ context "test with string" do
+ before do
+ write "a_test.rb", <<-RUBY
+ require 'test/unit'
+
+ class Xxx < Test::Unit::TestCase
+ test "a" do
+ puts 'ABC'
+ end
+
+ test "b" do
+ puts 'BCD'
+ end
+
+ test "c" do
+ puts 'CDE'
+ end
+ end
+ RUBY
+ end
+
+ it "runs test" do
+ result = testrbl "a_test.rb:8"
+ result.should_not include "ABC\n"
+ result.should include "BCD\n"
+ result.should_not include "CDE\n"
+ end
+ end
+
context "shoulda" do
before do
write "a_test.rb", <<-RUBY
require 'test/unit'
require 'shoulda'
@@ -98,11 +127,21 @@
end
should "e" do
puts 'DEF'
end
+
+ should "..'?! [(" do
+ puts 'EFG'
+ end
end
+
+ context "g" do
+ should "a" do
+ puts "FGH"
+ end
+ end
end
RUBY
end
it "runs should" do
@@ -110,15 +149,28 @@
result.should_not include "ABC\n"
result.should include "BCD\n"
result.should_not include "CDE\n"
end
+ it "runs stuff with regex special chars" do
+ result = testrbl "a_test.rb:22"
+ result.should_not include "DEF\n"
+ result.should include "EFG\n"
+ end
+
it "runs context" do
result = testrbl "a_test.rb:13"
result.should_not include "ABC\n"
result.should_not include "BCD\n"
result.should include "CDE\n"
result.should include "DEF\n"
+ end
+
+ it "runs via nested context" do
+ result = testrbl "a_test.rb:28"
+ result.should_not include "ABC\n"
+ result.should_not include "EFG\n"
+ result.should include "FGH\n"
end
end
context "multiple files / folders" do
before do