File: matchers_spec.rb

package info (click to toggle)
ruby-rspec-expectations 2.14.2-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 920 kB
  • sloc: ruby: 8,202; makefile: 4
file content (37 lines) | stat: -rw-r--r-- 895 bytes parent folder | download | duplicates (2)
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
31
32
33
34
35
36
37
require 'spec_helper'

module RSpec
  describe Matchers do

    let(:sample_matchers) do
      [:be,
       :be_close,
       :be_instance_of,
       :be_kind_of]
    end

    context "once required" do
      include TestUnitIntegrationSupport

      it "includes itself in Test::Unit::TestCase" do
        with_test_unit_loaded do
          test_unit_case = Test::Unit::TestCase.allocate
          sample_matchers.each do |sample_matcher|
              expect(test_unit_case).to respond_to(sample_matcher)
          end
        end
      end

      it "includes itself in MiniTest::Unit::TestCase", :if => defined?(MiniTest) do
        with_test_unit_loaded do
          minitest_case = MiniTest::Unit::TestCase.allocate
          sample_matchers.each do |sample_matcher|
              expect(minitest_case).to respond_to(sample_matcher)
          end
        end
      end

    end

  end
end