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



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

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

Instance Method Details

#appObject

Delegates to ‘Rails.application`.



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

def app
  Rails.application
end

#inspectObject

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



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

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

#mock_setupObject



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

def mock_setup
  RSpec::Mocks.setup
end

#mock_teardownObject



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

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

#responsesObject



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

def responses
  @responses ||= []
end