Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap T/U and/or MiniTest assertions in a separate scope from that of the
example.
- Loading branch information
1 parent
11e368e
commit 8660031
Showing
2 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require "spec_helper" | ||
|
||
describe RSpec::Rails::TestUnitAssertionAdapter do | ||
include RSpec::Rails::TestUnitAssertionAdapter | ||
|
||
Test::Unit::Assertions.public_instance_methods.select{|m| m.to_s =~ /^assert/}.each do |m| | ||
if m.to_s == "assert_equal" | ||
it "exposes #{m} to host examples" do | ||
assert_equal 3,3 | ||
expect do | ||
assert_equal 3,4 | ||
end.to raise_error(ActiveSupport::TestCase::Assertion) | ||
end | ||
else | ||
it "exposes #{m} to host examples" do | ||
methods.should include(m) | ||
end | ||
end | ||
end | ||
|
||
it "does not expose internal methods of MiniTest" do | ||
methods.should_not include("_assertions") | ||
end | ||
|
||
it "does not expose MiniTest's message method" do | ||
methods.should_not include("message") | ||
end | ||
end |