File: assertion_adapter_spec.rb

package info (click to toggle)
ruby-rspec-rails 8.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,804 kB
  • sloc: ruby: 10,881; sh: 198; makefile: 6
file content (30 lines) | stat: -rw-r--r-- 913 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
RSpec.describe RSpec::Rails::MinitestAssertionAdapter do
  include RSpec::Rails::MinitestAssertionAdapter

  RSpec::Rails::Assertions.public_instance_methods.select { |m| m.to_s =~ /^(assert|flunk|refute)/ }.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
        expect(methods).to include(m)
      end
    end
  end

  it "does not expose internal methods of Minitest" do
    expect(methods).not_to include("_assertions")
  end

  it "does not expose Minitest's message method" do
    expect(methods).not_to include("message")
  end

  it 'does not leak TestUnit specific methods into the AssertionDelegator' do
    expect(methods).to_not include(:build_message)
  end
end