n RSpec controller tests, it's common to stub ActiveRecord::Base.where, an inherited method. Which statements are true of such tests:a. The controller under test is tightly coupled to the modelb. In a static language, we'd have to use DI to achieve the same task in the testing framework.
A. only (a)
B. only (b)
C. both (a) and (b)
D. neither (a) nor (b)
查看答案
Your users are sporadically complaining that your site is slow, yet New Relic reports low traffic levels and low CPU utilization. What is the likely cause?
A. Not enough Heroku “dynos”, so requests occasionally get “backed up”
B. Some queries are unusually slow because you’re sharing DB with other apps
C. Some views take unusually long to render in certain browsers (eg, due to JavaScript)
D. It could be any of these/Not enough information
(a) In duck-typed languages, LSP violations can occur even when inheritance is not used(b) In statically-typed languages, if the compiler reports no type errors/warnings, then there are no LSP violations
A. Only (a) is true
B. Only (b) is true
C. Both are true
D. Both are false
The ability to perform a background request and update the HTML page in-place with the response relies on:(i) JavaScript(ii) The browser making the DOM available to JavaScript(iii) JSON(iv) XML(v) XmlHttpRequest
A. i and ii
B. iii and v
C. i, ii, and iii
D. i, ii, and v
E. i, iv, and v
Which Ruby language features support the DRYness enabled by validations and filters: (a) higher-order functions, (b) closures, (c) metaprogramming
A. Only (a)
B. Only (a) and (b)
C. Only (a) and (c)
D. (a), (b) and (c)