undefined method `[]' for nil:NilClass
Extracted source (around line #20):
18
19
20
21
22
23
|
def addresses_by_params(params, use_base_address = false)
Address::TYPES.map do |type|
form_params = params[:"#{type}_attributes"]
if use_base_address
form_params = params[:"#{Address::BASE}_attributes"]
form_params[:address_type] = type
|
Extracted source (around line #19):
17
18
19
20
21
22
|
def addresses_by_params(params, use_base_address = false)
Address::TYPES.map do |type|
form_params = params[:"#{type}_attributes"]
if use_base_address
form_params = params[:"#{Address::BASE}_attributes"]
|
Extracted source (around line #19):
17
18
19
20
21
22
|
def addresses_by_params(params, use_base_address = false)
Address::TYPES.map do |type|
form_params = params[:"#{type}_attributes"]
if use_base_address
form_params = params[:"#{Address::BASE}_attributes"]
|
Extracted source (around line #11):
9
10
11
12
13
14
|
@addressable = options[:order]
@params = options[:params]
@addresses = addresses_by_params(params[:order],
params[:use_base_address])
end
|
Extracted source (around line #6):
4
5
6
7
8
9
|
def self.call(*args, &block)
command = new(*args)
command.evaluate(&block) if block_given?
command.call
end
|
Extracted source (around line #6):
4
5
6
7
8
9
|
def self.call(*args, &block)
command = new(*args)
command.evaluate(&block) if block_given?
command.call
end
|
Extracted source (around line #27):
25
26
27
28
29
30
|
def update
options = { order: current_order, params: params, person: current_person }
"Corzinus::Checkout::Step#{step.capitalize}".constantize.call(options) do
on(:valid) { render_wizard current_order }
on(:invalid) do |step_results|
expose step_results if step_results
|
Extracted source (around line #4):
2
3
4
5
6
7
|
module BasicImplicitRender # :nodoc:
def send_action(method, *args)
super.tap { default_render unless performed? }
end
def default_render(*args)
|
Extracted source (around line #188):
186
187
188
189
190
191
|
# which is *not* necessarily the same as the action name.
def process_action(method_name, *args)
send_action(method_name, *args)
end
# Actually call the method associated with the action. Override
|
Extracted source (around line #30):
28
29
30
31
32
33
|
def process_action(*) #:nodoc:
self.formats = request.formats.map(&:ref).compact
super
end
# Check for double render errors and set the content_type after rendering.
|
Extracted source (around line #20):
18
19
20
21
22
23
|
def process_action(*args)
run_callbacks(:process_action) do
super
end
end
|
Extracted source (around line #126):
124
125
126
127
128
129
|
def call(env)
block = env.run_block
env.value = !env.halted && (!block || block.call)
env
end
end
|
Extracted source (around line #506):
504
505
506
507
508
509
|
def compile
@callbacks || @mutex.synchronize do
final_sequence = CallbackSequence.new { |env| Filters::ENDING.call(env) }
@callbacks ||= @chain.reverse.inject(final_sequence) do |callback_sequence, callback|
callback.apply callback_sequence
end
|
Extracted source (around line #455):
453
454
455
456
457
458
|
def call(arg)
@before.each { |b| b.call(arg) }
value = @call.call(arg)
@after.each { |a| a.call(arg) }
value
end
|
Extracted source (around line #101):
99
100
101
102
103
104
|
runner = callbacks.compile
e = Filters::Environment.new(self, false, nil, block)
runner.call(e).value
end
end
|
Extracted source (around line #750):
748
749
750
751
752
753
|
module_eval <<-RUBY, __FILE__, __LINE__ + 1
def _run_#{name}_callbacks(&block)
__run_callbacks__(_#{name}_callbacks, &block)
end
RUBY
end
|
Extracted source (around line #90):
88
89
90
91
92
93
|
# end
def run_callbacks(kind, &block)
send "_run_#{kind}_callbacks", &block
end
private
|
Extracted source (around line #19):
17
18
19
20
21
22
|
# process_action callbacks around the normal behavior.
def process_action(*args)
run_callbacks(:process_action) do
super
end
end
|
Extracted source (around line #20):
18
19
20
21
22
23
|
private
def process_action(*args)
super
rescue Exception => exception
request.env['action_dispatch.show_detailed_exceptions'] ||= show_detailed_exceptions?
rescue_with_handler(exception) || raise
|
Extracted source (around line #32):
30
31
32
33
34
35
|
ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
begin
result = super
payload[:status] = response.status
result
ensure
|
Extracted source (around line #164):
162
163
164
165
166
167
|
def instrument(name, payload = {})
if notifier.listening?(name)
instrumenter.instrument(name, payload) { yield payload if block_given? }
else
yield payload if block_given?
end
|
Extracted source (around line #21):
19
20
21
22
23
24
|
listeners_state = start name, payload
begin
yield payload
rescue Exception => e
payload[:exception] = [e.class.name, e.message]
payload[:exception_object] = e
|
Extracted source (around line #164):
162
163
164
165
166
167
|
def instrument(name, payload = {})
if notifier.listening?(name)
instrumenter.instrument(name, payload) { yield payload if block_given? }
else
yield payload if block_given?
end
|
Extracted source (around line #30):
28
29
30
31
32
33
|
ActiveSupport::Notifications.instrument("start_processing.action_controller", raw_payload.dup)
ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
begin
result = super
payload[:status] = response.status
|
Extracted source (around line #248):
246
247
248
249
250
251
|
request.filtered_parameters.merge! wrapped_filtered_hash
end
super
end
private
|
Extracted source (around line #18):
16
17
18
19
20
21
|
# and it won't be cleaned up by the method below.
ActiveRecord::LogSubscriber.reset_runtime
super
end
def cleanup_view_runtime
|
Extracted source (around line #126):
124
125
126
127
128
129
|
@_response_body = nil
process_action(action_name, *args)
end
# Delegates to the class' ::controller_path
|
Extracted source (around line #30):
28
29
30
31
32
33
|
def process(*) #:nodoc:
old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
super
ensure
I18n.config = old_config
end
|
Extracted source (around line #190):
188
189
190
191
192
193
|
set_request!(request)
set_response!(response)
process(name)
request.commit_flash
to_a
end
|
Extracted source (around line #262):
260
261
262
263
264
265
|
middleware_stack.build(name) { |env| new.dispatch(name, req, res) }.call req.env
else
new.dispatch(name, req, res)
end
end
end
|
Extracted source (around line #50):
48
49
50
51
52
53
|
def dispatch(controller, action, req, res)
controller.dispatch(action, req, res)
end
end
|
Extracted source (around line #32):
30
31
32
33
34
35
|
controller = controller req
res = controller.make_response! req
dispatch(controller, params[:action], req, res)
rescue ActionController::RoutingError
if @raise_on_name_error
raise
|
Extracted source (around line #39):
37
38
39
40
41
42
|
req.path_parameters = set_params.merge parameters
status, headers, body = route.app.serve(req)
if 'pass' == headers['X-Cascade']
req.script_name = script_name
|
Extracted source (around line #26):
24
25
26
27
28
29
|
def serve(req)
find_routes(req).each do |match, parameters, route|
set_params = req.path_parameters
path_info = req.path_info
script_name = req.script_name
|
Extracted source (around line #26):
24
25
26
27
28
29
|
def serve(req)
find_routes(req).each do |match, parameters, route|
set_params = req.path_parameters
path_info = req.path_info
script_name = req.script_name
|
Extracted source (around line #725):
723
724
725
726
727
728
|
req = make_request(env)
req.path_info = Journey::Router::Utils.normalize_path(req.path_info)
@router.serve(req)
end
def recognize_path(path, environment = {})
|
Extracted source (around line #522):
520
521
522
523
524
525
|
def call(env)
req = build_request env
app.call req.env
end
# Defines additional Rack env configuration that is added on each call.
|
Extracted source (around line #193):
191
192
193
194
195
196
|
def method_missing(name, *args, &block)
if instance.respond_to?(name)
instance.public_send(name, *args, &block)
else
super
end
|
Extracted source (around line #193):
191
192
193
194
195
196
|
def method_missing(name, *args, &block)
if instance.respond_to?(name)
instance.public_send(name, *args, &block)
else
super
end
|
Extracted source (around line #17):
15
16
17
18
19
20
|
SERVE = ->(app, req) { app.serve req }
CALL = ->(app, req) { app.call req.env }
def initialize(app, constraints, strategy)
# Unwrap Constraints objects. I don't actually think it's possible
|
Extracted source (around line #46):
44
45
46
47
48
49
|
return [ 404, {'X-Cascade' => 'pass'}, [] ] unless matches?(req)
@strategy.call @app, req
end
private
|
Extracted source (around line #39):
37
38
39
40
41
42
|
req.path_parameters = set_params.merge parameters
status, headers, body = route.app.serve(req)
if 'pass' == headers['X-Cascade']
req.script_name = script_name
|
Extracted source (around line #26):
24
25
26
27
28
29
|
def serve(req)
find_routes(req).each do |match, parameters, route|
set_params = req.path_parameters
path_info = req.path_info
script_name = req.script_name
|
Extracted source (around line #26):
24
25
26
27
28
29
|
def serve(req)
find_routes(req).each do |match, parameters, route|
set_params = req.path_parameters
path_info = req.path_info
script_name = req.script_name
|
Extracted source (around line #725):
723
724
725
726
727
728
|
req = make_request(env)
req.path_info = Journey::Router::Utils.normalize_path(req.path_info)
@router.serve(req)
end
def recognize_path(path, environment = {})
|
Extracted source (around line #25):
23
24
25
26
27
28
|
def call(env)
status, headers, body = @app.call(env)
if etag_status?(status) && etag_body?(body) && !skip_caching?(headers)
original_body = body
|
Extracted source (around line #38):
36
37
38
39
40
41
|
[status, headers, body]
else
@app.call(env)
end
end
|
Extracted source (around line #12):
10
11
12
13
14
15
|
def call(env)
status, headers, body = @app.call(env)
if env[REQUEST_METHOD] == HEAD
[
|
Extracted source (around line #222):
220
221
222
223
224
225
|
req = make_request env
prepare_session(req)
status, headers, body = app.call(req.env)
res = Rack::Response::Raw.new status, headers
commit_session(req, res)
[status, headers, body]
|
Extracted source (around line #216):
214
215
216
217
218
219
|
def call(env)
context(env)
end
def context(env, app=@app)
|
Extracted source (around line #613):
611
612
613
614
615
616
|
request = ActionDispatch::Request.new env
status, headers, body = @app.call(env)
if request.have_cookie_jar?
cookie_jar = request.cookie_jar
|
Extracted source (around line #553):
551
552
553
554
555
556
|
end
end
@app.call(env)
end
private
|
Extracted source (around line #38):
36
37
38
39
40
41
|
result = run_callbacks :call do
begin
@app.call(env)
rescue => error
end
end
|
Extracted source (around line #97):
95
96
97
98
99
100
|
def __run_callbacks__(callbacks, &block)
if callbacks.empty?
yield if block_given?
else
runner = callbacks.compile
e = Filters::Environment.new(self, false, nil, block)
|
Extracted source (around line #750):
748
749
750
751
752
753
|
module_eval <<-RUBY, __FILE__, __LINE__ + 1
def _run_#{name}_callbacks(&block)
__run_callbacks__(_#{name}_callbacks, &block)
end
RUBY
end
|
Extracted source (around line #90):
88
89
90
91
92
93
|
# end
def run_callbacks(kind, &block)
send "_run_#{kind}_callbacks", &block
end
private
|
Extracted source (around line #36):
34
35
36
37
38
39
|
def call(env)
error = nil
result = run_callbacks :call do
begin
@app.call(env)
rescue => error
|
Extracted source (around line #12):
10
11
12
13
14
15
|
state = @executor.run!
begin
response = @app.call(env)
returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! }
ensure
state.complete! unless returned
|
Extracted source (around line #79):
77
78
79
80
81
82
|
req = ActionDispatch::Request.new env
req.remote_ip = GetIp.new(req, check_ip, proxies)
@app.call(req.env)
end
# The GetIp class exists as a way to defer processing of the request data
|
Extracted source (around line #49):
47
48
49
50
51
52
|
def call(env)
request = ActionDispatch::Request.new env
_, headers, body = response = @app.call(env)
if headers['X-Cascade'] == 'pass'
body.close if body.respond_to?(:close)
|
Extracted source (around line #31):
29
30
31
32
33
34
|
def call(env)
request = ActionDispatch::Request.new env
@app.call(env)
rescue Exception => exception
if request.show_exceptions?
render_exception(request, exception)
|
Extracted source (around line #36):
34
35
36
37
38
39
|
instrumenter.start 'request.action_dispatch', request: request
logger.info { started_request_message(request) }
resp = @app.call(env)
resp[2] = ::Rack::BodyProxy.new(resp[2]) { finish(request) }
resp
rescue Exception
|
Extracted source (around line #24):
22
23
24
25
26
27
|
if logger.respond_to?(:tagged)
logger.tagged(compute_tags(request)) { call_app(request, env) }
else
call_app(request, env)
end
|
Extracted source (around line #69):
67
68
69
70
71
72
|
def tagged(*tags)
formatter.tagged(*tags) { yield self }
end
def flush
|
Extracted source (around line #26):
24
25
26
27
28
29
|
def tagged(*tags)
new_tags = push_tags(*tags)
yield self
ensure
pop_tags(new_tags.size)
end
|
Extracted source (around line #69):
67
68
69
70
71
72
|
def tagged(*tags)
formatter.tagged(*tags) { yield self }
end
def flush
|
Extracted source (around line #24):
22
23
24
25
26
27
|
if logger.respond_to?(:tagged)
logger.tagged(compute_tags(request)) { call_app(request, env) }
else
call_app(request, env)
end
|
Extracted source (around line #13):
11
12
13
14
15
16
|
::Rails.logger.silence { @app.call(env) }
else
@app.call(env)
end
end
end
|
Extracted source (around line #9):
7
8
9
10
11
12
|
def call(env)
RequestStore.begin!
@app.call(env)
ensure
RequestStore.end!
RequestStore.clear!
|
Extracted source (around line #24):
22
23
24
25
26
27
|
req = ActionDispatch::Request.new env
req.request_id = make_request_id(req.x_request_id)
@app.call(env).tap { |_status, headers, _body| headers[X_REQUEST_ID] = req.request_id }
end
private
|
Extracted source (around line #22):
20
21
22
23
24
25
|
end
@app.call(env)
end
def method_override(env)
|
Extracted source (around line #22):
20
21
22
23
24
25
|
def call(env)
start_time = Utils.clock_time
status, headers, body = @app.call(env)
request_time = Utils.clock_time - start_time
unless headers.has_key?(@header_name)
|
Extracted source (around line #28):
26
27
28
29
30
31
|
def call(env)
LocalCacheRegistry.set_cache_for(local_cache_key, LocalStore.new)
response = @app.call(env)
response[2] = ::Rack::BodyProxy.new(response[2]) do
LocalCacheRegistry.set_cache_for(local_cache_key, nil)
end
|
Extracted source (around line #12):
10
11
12
13
14
15
|
state = @executor.run!
begin
response = @app.call(env)
returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! }
ensure
state.complete! unless returned
|
Extracted source (around line #136):
134
135
136
137
138
139
|
end
@app.call(req.env)
end
end
end
|
Extracted source (around line #111):
109
110
111
112
113
114
|
def call(env)
status, headers, body = @app.call(env)
if body.respond_to?(:to_path)
case type = variation(env)
when 'X-Accel-Redirect'
|
Extracted source (around line #522):
520
521
522
523
524
525
|
def call(env)
req = build_request env
app.call req.env
end
# Defines additional Rack env configuration that is added on each call.
|
Extracted source (around line #68):
66
67
68
69
70
71
|
env[PATH_INFO] = rest
return app.call(env)
end
[404, {CONTENT_TYPE => "text/plain", "X-Cascade" => "pass"}, ["Not Found: #{path}"]]
|
Extracted source (around line #53):
51
52
53
54
55
56
|
casecmp?(http_host, "#{server_name}:#{server_port}")
@mapping.each do |host, location, match, app|
unless casecmp?(http_host, host) \
|| casecmp?(server_name, host) \
|| (!host && is_same_server)
|
Extracted source (around line #53):
51
52
53
54
55
56
|
casecmp?(http_host, "#{server_name}:#{server_port}")
@mapping.each do |host, location, match, app|
unless casecmp?(http_host, host) \
|| casecmp?(server_name, host) \
|| (!host && is_same_server)
|
Extracted source (around line #30):
28
29
30
31
32
33
|
env["HTTP_COOKIE"] ||= cookie_jar.for(uri)
@last_request = Rack::Request.new(env)
status, headers, body = @app.call(@last_request.env)
@last_response = MockResponse.new(status, headers, body, env["rack.errors"].flush)
body.close if body.respond_to?(:close)
|
Extracted source (around line #244):
242
243
244
245
246
247
|
uri.host ||= @default_host
@rack_mock_session.request(uri, env)
if retry_with_digest_auth?(env)
auth_env = env.merge({
|
Extracted source (around line #67):
65
66
67
68
69
70
|
def post(uri, params = {}, env = {}, &block)
env = env_for(uri, env.merge(:method => "POST", :params => params))
process_request(uri, env, &block)
end
# Issue a PUT request for the given URI. See #get
|
Extracted source (around line #189):
187
188
189
190
191
192
|
def #{ali}(*args, &block)
begin
#{accessor}.__send__(:#{method}, *args, &block)
rescue ::Exception
$@.delete_if{|s| ::Forwardable::FILE_REGEXP =~ s} unless ::Forwardable::debug
::Kernel::raise
|
Extracted source (around line #61):
59
60
61
62
63
64
|
reset_cache!
send(method, new_uri.to_s, attributes, env.merge(options[:headers] || {}))
end
def current_url
|
Extracted source (around line #36):
34
35
36
37
38
39
|
def process_and_follow_redirects(method, path, attributes = {}, env = {})
process(method, path, attributes, env)
if driver.follow_redirects?
driver.redirect_limit.times do
process(:get, last_response["Location"], {}, env) if last_response.redirect?
|
Extracted source (around line #27):
25
26
27
28
29
30
|
def submit(method, path, attributes)
path = request_path if not path or path.empty?
process_and_follow_redirects(method, path, attributes, {'HTTP_REFERER' => current_url})
end
def follow(method, path, attributes = {})
|
Extracted source (around line #79):
77
78
79
80
81
82
|
action = (button && button['formaction']) || native['action']
method = (button && button['formmethod']) || request_method
driver.submit(method, action.to_s, params(button))
end
def multipart?
|
Extracted source (around line #62):
60
61
62
63
64
65
|
((tag_name == 'button') and type.nil? or type == "submit")
associated_form = form
Capybara::RackTest::Form.new(driver, associated_form).submit(self) if associated_form
elsif (tag_name == 'label')
labelled_control = if native[:for]
find_xpath("//input[@id='#{native[:for]}']").first
|
Extracted source (around line #143):
141
142
143
144
145
146
|
# @return [Capybara::Node::Element] The element
def click
synchronize { base.click }
return self
end
|
Extracted source (around line #85):
83
84
85
86
87
88
|
session.synchronized = true
begin
yield
rescue => e
session.raise_server_error!
raise e unless driver.wait?
|
Extracted source (around line #143):
141
142
143
144
145
146
|
# @return [Capybara::Node::Element] The element
def click
synchronize { base.click }
return self
end
|
Extracted source (around line #61):
59
60
61
62
63
64
|
def click_button(locator=nil, options={})
locator, options = nil, locator if locator.is_a? Hash
find(:button, locator, options).click
end
##
|
Extracted source (around line #780):
778
779
780
781
782
783
|
define_method method do |*args, &block|
@touched = true
current_scope.send(method, *args, &block)
end
end
|
Extracted source (around line #52):
50
51
52
53
54
55
|
Session::DSL_METHODS.each do |method|
define_method method do |*args, &block|
page.send method, *args, &block
end
end
end
|
Extracted source (around line #31):
29
30
31
32
33
34
|
text = I18n.t('corzinus.checkouts.address.use_base_address')
first('label', text: text).click
click_button I18n.t('simple_form.corzinus.titles.save_and_continue')
expect(current_path).to eq corzinus.checkout_path(id: :delivery)
visit corzinus.checkout_path(id: :address)
expect(find('#use_base_address', visible: false)).to be_checked
|
Extracted source (around line #254):
252
253
254
255
256
257
|
begin
run_before_example
@example_group_instance.instance_exec(self, &@example_block)
if pending?
Pending.mark_fixed! self
|
Extracted source (around line #254):
252
253
254
255
256
257
|
begin
run_before_example
@example_group_instance.instance_exec(self, &@example_block)
if pending?
Pending.mark_fixed! self
|
Extracted source (around line #496):
494
495
496
497
498
499
|
singleton_context_hooks_host = example_group_instance.singleton_class
singleton_context_hooks_host.run_before_context_hooks(example_group_instance)
with_around_example_hooks { yield }
ensure
singleton_context_hooks_host.run_after_context_hooks(example_group_instance)
end
|
Extracted source (around line #453):
451
452
453
454
455
456
|
def with_around_example_hooks
hooks.run(:around, :example, self) { yield }
rescue Support::AllExceptionsExceptOnesWeMustNotRescue => e
set_exception(e)
end
|
Extracted source (around line #464):
462
463
464
465
466
467
|
when :before then run_example_hooks_for(example_or_group, :before, :reverse_each)
when :after then run_example_hooks_for(example_or_group, :after, :each)
when :around then run_around_example_hooks_for(example_or_group) { yield }
end
end
end
|
Extracted source (around line #604):
602
603
604
605
606
607
|
return yield if hooks.empty? # exit early to avoid the extra allocation cost of `Example::Procsy`
initial_procsy = Example::Procsy.new(example) { yield }
hooks.inject(initial_procsy) do |procsy, around_hook|
procsy.wrap { around_hook.execute_with(example, procsy) }
end.call
|
Extracted source (around line #338):
336
337
338
339
340
341
|
def call(*args, &block)
@executed = true
@proc.call(*args, &block)
end
alias run call
|
Extracted source (around line #127):
125
126
127
128
129
130
|
group.around do |example|
before_setup
example.run
after_teardown
end
end
|
Extracted source (around line #443):
441
442
443
444
445
446
|
# @private
def instance_exec(*args, &block)
@example_group_instance.instance_exec(*args, &block)
end
private
|
Extracted source (around line #443):
441
442
443
444
445
446
|
# @private
def instance_exec(*args, &block)
@example_group_instance.instance_exec(*args, &block)
end
private
|
Extracted source (around line #375):
373
374
375
376
377
378
|
class AroundHook < Hook
def execute_with(example, procsy)
example.instance_exec(procsy, &block)
return if procsy.executed?
Pending.mark_skipped!(example,
"#{hook_description} did not execute the example")
|
Extracted source (around line #606):
604
605
606
607
608
609
|
initial_procsy = Example::Procsy.new(example) { yield }
hooks.inject(initial_procsy) do |procsy, around_hook|
procsy.wrap { around_hook.execute_with(example, procsy) }
end.call
end
|
Extracted source (around line #338):
336
337
338
339
340
341
|
def call(*args, &block)
@executed = true
@proc.call(*args, &block)
end
alias run call
|
Extracted source (around line #607):
605
606
607
608
609
610
|
hooks.inject(initial_procsy) do |procsy, around_hook|
procsy.wrap { around_hook.execute_with(example, procsy) }
end.call
end
if respond_to?(:singleton_class) && singleton_class.ancestors.include?(singleton_class)
|
Extracted source (around line #464):
462
463
464
465
466
467
|
when :before then run_example_hooks_for(example_or_group, :before, :reverse_each)
when :after then run_example_hooks_for(example_or_group, :after, :each)
when :around then run_around_example_hooks_for(example_or_group) { yield }
end
end
end
|
Extracted source (around line #453):
451
452
453
454
455
456
|
def with_around_example_hooks
hooks.run(:around, :example, self) { yield }
rescue Support::AllExceptionsExceptOnesWeMustNotRescue => e
set_exception(e)
end
|
Extracted source (around line #496):
494
495
496
497
498
499
|
singleton_context_hooks_host = example_group_instance.singleton_class
singleton_context_hooks_host.run_before_context_hooks(example_group_instance)
with_around_example_hooks { yield }
ensure
singleton_context_hooks_host.run_after_context_hooks(example_group_instance)
end
|
Extracted source (around line #251):
249
250
251
252
253
254
|
Pending.mark_pending! self, skip
elsif !RSpec.configuration.dry_run?
with_around_and_singleton_context_hooks do
begin
run_before_example
@example_group_instance.instance_exec(self, &@example_block)
|
Extracted source (around line #627):
625
626
627
628
629
630
|
instance = new(example.inspect_output)
set_ivars(instance, before_context_ivars)
succeeded = example.run(instance, reporter)
if !succeeded && reporter.fail_fast_limit_met?
RSpec.world.wants_to_quit = true
end
|
Extracted source (around line #623):
621
622
623
624
625
626
|
# @private
def self.run_examples(reporter)
ordering_strategy.order(filtered_examples).map do |example|
next if RSpec.world.wants_to_quit
instance = new(example.inspect_output)
set_ivars(instance, before_context_ivars)
|
Extracted source (around line #623):
621
622
623
624
625
626
|
# @private
def self.run_examples(reporter)
ordering_strategy.order(filtered_examples).map do |example|
next if RSpec.world.wants_to_quit
instance = new(example.inspect_output)
set_ivars(instance, before_context_ivars)
|
Extracted source (around line #589):
587
588
589
590
591
592
|
begin
run_before_context_hooks(new('before(:context) hook')) if should_run_context_hooks
result_for_this_group = run_examples(reporter)
results_for_descendants = ordering_strategy.order(children).map { |child| child.run(reporter) }.all?
result_for_this_group && results_for_descendants
rescue Pending::SkipDeclaredInExample => ex
|
Extracted source (around line #113):
111
112
113
114
115
116
|
success = @configuration.reporter.report(@world.example_count(example_groups)) do |reporter|
@configuration.with_suite_hooks do
example_groups.map { |g| g.run(reporter) }.all?
end
end && !@world.non_example_failure
|
Extracted source (around line #113):
111
112
113
114
115
116
|
success = @configuration.reporter.report(@world.example_count(example_groups)) do |reporter|
@configuration.with_suite_hooks do
example_groups.map { |g| g.run(reporter) }.all?
end
end && !@world.non_example_failure
|
Extracted source (around line #113):
111
112
113
114
115
116
|
success = @configuration.reporter.report(@world.example_count(example_groups)) do |reporter|
@configuration.with_suite_hooks do
example_groups.map { |g| g.run(reporter) }.all?
end
end && !@world.non_example_failure
|
Extracted source (around line #1835):
1833
1834
1835
1836
1837
1838
|
begin
run_suite_hooks("a `before(:suite)` hook", @before_suite_hooks)
yield
ensure
run_suite_hooks("an `after(:suite)` hook", @after_suite_hooks)
end
|
Extracted source (around line #112):
110
111
112
113
114
115
|
def run_specs(example_groups)
success = @configuration.reporter.report(@world.example_count(example_groups)) do |reporter|
@configuration.with_suite_hooks do
example_groups.map { |g| g.run(reporter) }.all?
end
end && !@world.non_example_failure
|
Extracted source (around line #77):
75
76
77
78
79
80
|
start(expected_example_count)
begin
yield self
ensure
finish
end
|
Extracted source (around line #111):
109
110
111
112
113
114
|
# failed.
def run_specs(example_groups)
success = @configuration.reporter.report(@world.example_count(example_groups)) do |reporter|
@configuration.with_suite_hooks do
example_groups.map { |g| g.run(reporter) }.all?
end
|
Extracted source (around line #87):
85
86
87
88
89
90
|
def run(err, out)
setup(err, out)
run_specs(@world.ordered_example_groups).tap do
persist_example_statuses
end
end
|
Extracted source (around line #71):
69
70
71
72
73
74
|
options.options[:runner].call(options, err, out)
else
new(options).run(err, out)
end
end
|
Extracted source (around line #45):
43
44
45
46
47
48
|
def self.invoke
disable_autorun!
status = run(ARGV, $stderr, $stdout).to_i
exit(status) if status != 0
end
|
Extracted source (around line #4):
2
3
4
|
require 'rspec/core'
RSpec::Core::Runner.invoke
|
Extracted source (around line #23):
21
22
23
|
gem 'rspec-core', version
load Gem.bin_path('rspec-core', 'rspec', version)
|
Extracted source (around line #23):
21
22
23
|
gem 'rspec-core', version
load Gem.bin_path('rspec-core', 'rspec', version)
|
Extracted source (around line #15):
13
14
15
|
end
eval File.read($0), binding, $0
|
Extracted source (around line #15):
13
14
15
|
end
eval File.read($0), binding, $0
|
Rails.root: /home/yaroslav/Learn/Rails/corzinus/spec/dummy
Request
Parameters:
{"utf8"=>"✓",
"_method"=>"patch",
"authenticity_token"=>"o5IB/G4mKOA/DeeSKwCRAMQKNAC8JqvPsTTQbZOtEGTunsp683iT17Qo5FkTJh+myagep2ePHbTdR+876qVeXw==",
"use_base_address"=>"on",
"commit"=>"Save and Continue",
"id"=>"address"}
_csrf_token: "TQzLhp1euzeLJQPLOCaOpg2iKqfbqbZ7bHM/VnkITjs="
session_id: "00f33ffb7be30fbe01442edf964ba25f"
ORIGINAL_SCRIPT_NAME: ""
REMOTE_ADDR: "127.0.0.1"
SERVER_NAME: "www.example.com"
Response
Headers:
None