Class: Google::Apis::FirebaserulesV1::TestCase
- Inherits:
-
Object
- Object
- Google::Apis::FirebaserulesV1::TestCase
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/firebaserules_v1/classes.rb,
lib/google/apis/firebaserules_v1/representations.rb,
lib/google/apis/firebaserules_v1/representations.rb
Overview
TestCase messages provide the request context and an expectation as to
whether the given context will be allowed or denied. Test cases may specify
the request, resource, and function_mocks to mock a function call to a
service-provided function. The request object represents context present at
request-time. The resource is the value of the target resource as it appears
in persistent storage before the request is executed.
Instance Attribute Summary collapse
-
#expectation ⇒ String
Test expectation.
-
#expression_report_level ⇒ String
Specifies what should be included in the response.
-
#function_mocks ⇒ Array<Google::Apis::FirebaserulesV1::FunctionMock>
Optional function mocks for service-defined functions.
-
#path_encoding ⇒ String
Specifies whether paths (such as request.path) are encoded and how.
-
#request ⇒ Object
Request context.
-
#resource ⇒ Object
Optional resource value as it appears in persistent storage before the request is fulfilled.
Instance Method Summary collapse
-
#initialize(**args) ⇒ TestCase
constructor
A new instance of TestCase.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ TestCase
Returns a new instance of TestCase.
576 577 578 |
# File 'lib/google/apis/firebaserules_v1/classes.rb', line 576 def initialize(**args) update!(**args) end |
Instance Attribute Details
#expectation ⇒ String
Test expectation.
Corresponds to the JSON property expectation
539 540 541 |
# File 'lib/google/apis/firebaserules_v1/classes.rb', line 539 def expectation @expectation end |
#expression_report_level ⇒ String
Specifies what should be included in the response.
Corresponds to the JSON property expressionReportLevel
544 545 546 |
# File 'lib/google/apis/firebaserules_v1/classes.rb', line 544 def expression_report_level @expression_report_level end |
#function_mocks ⇒ Array<Google::Apis::FirebaserulesV1::FunctionMock>
Optional function mocks for service-defined functions. If not set, any service
defined function is expected to return an error, which may or may not
influence the test outcome.
Corresponds to the JSON property functionMocks
551 552 553 |
# File 'lib/google/apis/firebaserules_v1/classes.rb', line 551 def function_mocks @function_mocks end |
#path_encoding ⇒ String
Specifies whether paths (such as request.path) are encoded and how.
Corresponds to the JSON property pathEncoding
556 557 558 |
# File 'lib/google/apis/firebaserules_v1/classes.rb', line 556 def path_encoding @path_encoding end |
#request ⇒ Object
Request context. The exact format of the request context is service-dependent.
See the appropriate service documentation for information about the supported
fields and types on the request. Minimally, all services support the following
fields and types: Request field | Type ---------------|----------------- auth.
uid | string auth.token | map headers | map method | string params |
map path | string time | google.protobuf.Timestamp If the request value
is not well-formed for the service, the request will be rejected as an invalid
argument.
Corresponds to the JSON property request
568 569 570 |
# File 'lib/google/apis/firebaserules_v1/classes.rb', line 568 def request @request end |
#resource ⇒ Object
Optional resource value as it appears in persistent storage before the request
is fulfilled. The resource type depends on the request.path value.
Corresponds to the JSON property resource
574 575 576 |
# File 'lib/google/apis/firebaserules_v1/classes.rb', line 574 def resource @resource end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
581 582 583 584 585 586 587 588 |
# File 'lib/google/apis/firebaserules_v1/classes.rb', line 581 def update!(**args) @expectation = args[:expectation] if args.key?(:expectation) @expression_report_level = args[:expression_report_level] if args.key?(:expression_report_level) @function_mocks = args[:function_mocks] if args.key?(:function_mocks) @path_encoding = args[:path_encoding] if args.key?(:path_encoding) @request = args[:request] if args.key?(:request) @resource = args[:resource] if args.key?(:resource) end |