File: verified_doubles.feature

package info (click to toggle)
ruby-rspec-rails 7.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,796 kB
  • sloc: ruby: 11,068; sh: 198; makefile: 6
file content (19 lines) | stat: -rw-r--r-- 577 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Feature: Using verified doubles

  By default rspec verified doubles dont support dynamic methods on
  `instance_double`. `rspec-rails` enabled this support for column
  methods through an extension.

  Scenario:
    Given a file named "spec/models/widget_spec.rb" with:
      """ruby
      require "rails_helper"

      RSpec.describe Widget, type: :model do
        it "has one after adding one" do
          instance_double("Widget", :name => "my name")
        end
      end
      """
    When I run `rspec spec/models/widget_spec.rb`
    Then the examples should all pass