Class: ResponseDumper

Inherits:
Object
  • Object
show all
Includes:
ActionDispatch::Integration::Runner, ActiveSupport::Testing::TimeHelpers, RSpec::Mocks::ExampleMethods
Defined in:
lib/response_dumper.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.define(name, &block) ⇒ Object



11
12
13
# File 'lib/response_dumper.rb', line 11

def self.define(name, &block)
  RailsResponseDumper::Defined.new(name, &block)
end

Instance Method Details

#appObject

Delegates to ‘Rails.application`.



16
17
18
# File 'lib/response_dumper.rb', line 16

def app
  Rails.application
end

#inspectObject

The list of methods is too long to be useful so shorten to just the class name.



46
47
48
# File 'lib/response_dumper.rb', line 46

def inspect
  "#<#{self.class.name}>"
end

#mock_setupObject



24
25
26
# File 'lib/response_dumper.rb', line 24

def mock_setup
  RSpec::Mocks.setup
end

#mock_teardownObject



28
29
30
31
32
# File 'lib/response_dumper.rb', line 28

def mock_teardown
  RSpec::Mocks.verify
ensure
  RSpec::Mocks.teardown
end

#responsesObject



20
21
22
# File 'lib/response_dumper.rb', line 20

def responses
  @responses ||= []
end