Ruby 1.9-compat - test for MiniTest::Assertion instead of T::U::AssertionFailedError
This commit is contained in:
parent
987766b10d
commit
d9ebabf461
@ -56,13 +56,13 @@ describe "contain" do
|
|||||||
it "should throw an exception when the body doesnt contain the text" do
|
it "should throw an exception when the body doesnt contain the text" do
|
||||||
lambda {
|
lambda {
|
||||||
assert_contain("monkeys")
|
assert_contain("monkeys")
|
||||||
}.should raise_error(Test::Unit::AssertionFailedError)
|
}.should raise_error(AssertionFailedError)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should throw an exception when the body doesnt contain the regexp" do
|
it "should throw an exception when the body doesnt contain the regexp" do
|
||||||
lambda {
|
lambda {
|
||||||
assert_contain(/monkeys/)
|
assert_contain(/monkeys/)
|
||||||
}.should raise_error(Test::Unit::AssertionFailedError)
|
}.should raise_error(AssertionFailedError)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -78,13 +78,13 @@ describe "contain" do
|
|||||||
it "should throw an exception when the body does contain the text" do
|
it "should throw an exception when the body does contain the text" do
|
||||||
lambda {
|
lambda {
|
||||||
assert_not_contain("hello, world")
|
assert_not_contain("hello, world")
|
||||||
}.should raise_error(Test::Unit::AssertionFailedError)
|
}.should raise_error(AssertionFailedError)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should throw an exception when the body does contain the regexp" do
|
it "should throw an exception when the body does contain the regexp" do
|
||||||
lambda {
|
lambda {
|
||||||
assert_not_contain(/hello, world/)
|
assert_not_contain(/hello, world/)
|
||||||
}.should raise_error(Test::Unit::AssertionFailedError)
|
}.should raise_error(AssertionFailedError)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -122,7 +122,7 @@ describe "have_selector" do
|
|||||||
it "should throw an exception when the body doesnt have matching selection" do
|
it "should throw an exception when the body doesnt have matching selection" do
|
||||||
lambda {
|
lambda {
|
||||||
assert_have_selector("p")
|
assert_have_selector("p")
|
||||||
}.should raise_error(Test::Unit::AssertionFailedError)
|
}.should raise_error(AssertionFailedError)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ describe "have_selector" do
|
|||||||
it "should throw an exception when the body does contain the selection" do
|
it "should throw an exception when the body does contain the selection" do
|
||||||
lambda {
|
lambda {
|
||||||
assert_have_no_selector("div")
|
assert_have_no_selector("div")
|
||||||
}.should raise_error(Test::Unit::AssertionFailedError)
|
}.should raise_error(AssertionFailedError)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -117,7 +117,7 @@ describe "have_xpath" do
|
|||||||
it "should throw an exception when the body doesnt have matching xpath" do
|
it "should throw an exception when the body doesnt have matching xpath" do
|
||||||
lambda {
|
lambda {
|
||||||
assert_have_xpath("//p")
|
assert_have_xpath("//p")
|
||||||
}.should raise_error(Test::Unit::AssertionFailedError)
|
}.should raise_error(AssertionFailedError)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ describe "have_xpath" do
|
|||||||
it "should throw an exception when the body does contain the xpath" do
|
it "should throw an exception when the body does contain the xpath" do
|
||||||
lambda {
|
lambda {
|
||||||
assert_have_no_xpath("//div")
|
assert_have_no_xpath("//div")
|
||||||
}.should raise_error(Test::Unit::AssertionFailedError)
|
}.should raise_error(AssertionFailedError)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -8,6 +8,8 @@ begin require "redgreen" unless ENV['TM_CURRENT_LINE']; rescue LoadError; end
|
|||||||
webrat_path = File.expand_path(File.dirname(__FILE__) + "/../lib/")
|
webrat_path = File.expand_path(File.dirname(__FILE__) + "/../lib/")
|
||||||
$LOAD_PATH.unshift(webrat_path) unless $LOAD_PATH.include?(webrat_path)
|
$LOAD_PATH.unshift(webrat_path) unless $LOAD_PATH.include?(webrat_path)
|
||||||
|
|
||||||
|
AssertionFailedError = Test::Unit::AssertionFailedError rescue MiniTest::Assertion # ruby1.9 compat
|
||||||
|
|
||||||
require "webrat"
|
require "webrat"
|
||||||
require File.expand_path(File.dirname(__FILE__) + "/fakes/test_session")
|
require File.expand_path(File.dirname(__FILE__) + "/fakes/test_session")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user