File: ruby.feature

package info (click to toggle)
ruby-rspec 3.4.0c3e0m1s1-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 6,124 kB
  • sloc: ruby: 59,418; sh: 1,405; makefile: 98
file content (27 lines) | stat: -rw-r--r-- 825 bytes parent folder | download | duplicates (5)
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
Feature: run with `ruby` command

  You can use the `ruby` command to run specs. You just need to require
  `rspec/autorun`.

  Generally speaking, you're better off using the `rspec` command, which avoids
  the complexity of `rspec/autorun` (e.g. no `at_exit` hook needed!), but some
  tools only work with the `ruby` command.

  Scenario: Require `rspec/autorun` from a spec file
    Given a file named "example_spec.rb" with:
      """ruby
      require 'rspec/autorun'

      RSpec.describe 1 do
        it "is < 2" do
          expect(1).to be < 2
        end

        it "has an intentional failure" do
          expect(1).to be > 2
        end
      end
      """
    When I run `ruby example_spec.rb`
    Then the output should contain "2 examples, 1 failure"
     And the output should contain "expect(1).to be > 2"