Module: RSpec::Approvals::DSL

Defined in:
lib/rspec/approvals/dsl.rb

Instance Method Summary collapse

Instance Method Details

#approve(description) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rspec/approvals/dsl.rb', line 7

def approve(description)

  specify(description) do
    approval = Approval.new(example, yield)

    # We may be able to set file_path and
    # line_number on example in the approval
    # see RSpec::Core::Metadata::LocationKeys
    approval.location = caller

    approval.verify
  end
end