Sha256: b9084577ef13e203fb48634dd3b8d48925e5b615b6bb34166e70b2086148f567

Contents?: true

Size: 1.45 KB

Versions: 201

Compression:

Stored size: 1.45 KB

Contents

Feature: Test::Unit integration

  RSpec-expectations is a stand-alone gem that can be used without
  the rest of RSpec.  It can easily be used with another test
  framework such as Test::Unit if you like RSpec's should/should_not
  syntax but prefer the test organization of another framework.

  Scenario: Basic Test::Unit usage
    Given a file named "rspec_expectations_test.rb" with:
      """
      require 'test/unit'
      require 'rspec/expectations'

      class RSpecExpectationsTest < Test::Unit::TestCase
        RSpec::Matchers.define :be_an_integer do
          match { |actual| Integer === actual }
        end

        def be_an_int
          RSpec.deprecate(:be_an_int, :be_an_integer)
          be_an_integer
        end

        def test_passing_expectation
          x = 1 + 3
          x.should == 4
        end

        def test_failing_expectation
          array = [1, 2]
          array.should be_empty
        end

        def test_expect_matcher
          expect { @a = 5 }.to change { @a }.from(nil).to(5)
        end

        def test_custom_matcher_and_deprecation_warning
          1.should be_an_int
        end
      end
      """
     When I run `ruby rspec_expectations_test.rb`
     Then the output should contain "4 tests, 0 assertions, 1 failures, 0 errors" or "4 tests, 0 assertions, 0 failures, 1 errors"
      And the output should contain "expected empty? to return true, got false"
      And the output should contain "be_an_int is deprecated"

Version data entries

201 entries across 100 versions & 14 rubygems

Version Path
classiccms-0.5.15 vendor/bundle/gems/rspec-expectations-2.9.1/features/test_frameworks/test_unit.feature
classiccms-0.5.15 vendor/bundle/gems/rspec-expectations-2.9.0/features/test_frameworks/test_unit.feature
classiccms-0.5.14 vendor/bundle/gems/rspec-expectations-2.10.0/features/test_frameworks/test_unit.feature
classiccms-0.5.14 vendor/bundle/gems/rspec-expectations-2.9.0/features/test_frameworks/test_unit.feature
classiccms-0.5.14 vendor/bundle/gems/rspec-expectations-2.9.1/features/test_frameworks/test_unit.feature
classiccms-0.5.13 vendor/bundle/gems/rspec-expectations-2.9.1/features/test_frameworks/test_unit.feature
classiccms-0.5.13 vendor/bundle/gems/rspec-expectations-2.10.0/features/test_frameworks/test_unit.feature
classiccms-0.5.13 vendor/bundle/gems/rspec-expectations-2.9.0/features/test_frameworks/test_unit.feature
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/rspec-expectations-2.11.2/features/test_frameworks/test_unit.feature
rspec-expectations-2.11.3 features/test_frameworks/test_unit.feature
classiccms-0.5.12 vendor/bundle/gems/rspec-expectations-2.9.0/features/test_frameworks/test_unit.feature
classiccms-0.5.12 vendor/bundle/gems/rspec-expectations-2.10.0/features/test_frameworks/test_unit.feature
classiccms-0.5.12 vendor/bundle/gems/rspec-expectations-2.9.1/features/test_frameworks/test_unit.feature
classiccms-0.5.11 vendor/bundle/gems/rspec-expectations-2.9.1/features/test_frameworks/test_unit.feature
classiccms-0.5.11 vendor/bundle/gems/rspec-expectations-2.9.0/features/test_frameworks/test_unit.feature
classiccms-0.5.11 vendor/bundle/gems/rspec-expectations-2.10.0/features/test_frameworks/test_unit.feature
classiccms-0.5.10 vendor/bundle/gems/rspec-expectations-2.9.1/features/test_frameworks/test_unit.feature
classiccms-0.5.10 vendor/bundle/gems/rspec-expectations-2.9.0/features/test_frameworks/test_unit.feature
classiccms-0.5.10 vendor/bundle/gems/rspec-expectations-2.10.0/features/test_frameworks/test_unit.feature
classiccms-0.5.9 vendor/bundle/gems/rspec-expectations-2.10.0/features/test_frameworks/test_unit.feature