Sha256: b33f8bf4b743fe4a548dac55d204ef0c545606862d606b649e519209da8a9b73

Contents?: true

Size: 1.47 KB

Versions: 71

Compression:

Stored size: 1.47 KB

Contents

Feature: end_with matcher

  Use the `end_with` matcher to specify that a string or array ends with the
  expected characters or elements.

    "this string".should end_with "string"
    "this string".should_not end_with "stringy"
    [0, 1, 2].should end_with 1, 2

  Scenario: string usage
    Given a file named "example_spec.rb" with:
      """
      describe "this string" do
        it { should end_with "string" }
        it { should_not end_with "stringy" }

        # deliberate failures
        it { should_not end_with "string" }
        it { should end_with "stringy" }
      end
      """
    When I run `rspec example_spec.rb`
    Then the output should contain all of these:
      | 4 examples, 2 failures                          |
      | expected "this string" not to end with "string" |
      | expected "this string" to end with "stringy"    |

  Scenario: array usage
    Given a file named "example_spec.rb" with:
      """
      describe [0, 1, 2, 3, 4] do
        it { should end_with 4 }
        it { should end_with 3, 4 }
        it { should_not end_with 3 }
        it { should_not end_with 0, 1, 2, 3, 4, 5 }

        # deliberate failures
        it { should_not end_with 4 }
        it { should end_with 3 }
      end
      """
    When I run `rspec example_spec.rb`
    Then the output should contain all of these:
      | 6 examples, 2 failures                     |
      | expected [0, 1, 2, 3, 4] not to end with 4 |
      | expected [0, 1, 2, 3, 4] to end with 3     |

Version data entries

71 entries across 66 versions & 9 rubygems

Version Path
rspec-expectations-2.11.2 features/built_in_matchers/end_with.feature
classiccms-0.4.2 vendor/bundle/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
rspec-expectations-2.11.1 features/built_in_matchers/end_with.feature
rspec-expectations-2.11.0 features/built_in_matchers/end_with.feature
classiccms-0.4.1 vendor/bundle/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
classiccms-0.4.0 vendor/bundle/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
classiccms-0.3.9 vendor/bundle/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
classiccms-0.3.8 vendor/bundle/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
classiccms-0.3.7 vendor/bundle/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
classiccms-0.3.6 vendor/bundle/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature
classiccms-0.3.5 vendor/bundle/gems/rspec-expectations-2.10.0/features/built_in_matchers/end_with.feature