Class: Webspicy::Configuration::SingleUrl::SingleUrlScope
- Inherits:
-
Webspicy::Configuration::Scope
- Object
- Webspicy::Configuration::Scope
- Webspicy::Configuration::SingleUrl::SingleUrlScope
- Defined in:
- lib/webspicy/configuration/single_url.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Attributes inherited from Webspicy::Configuration::Scope
Instance Method Summary collapse
- #each_specification {|Webspicy.specification(spec, nil, self)| ... } ⇒ Object
-
#initialize(config, url) ⇒ SingleUrlScope
constructor
A new instance of SingleUrlScope.
Methods inherited from Webspicy::Configuration::Scope
#data_system, #each_counterexamples, #each_example, #each_generated_counterexamples, #each_service, #each_specification_file, #each_testcase, #find_test_case, #get_client, #parse_schema, #to_real_url
Constructor Details
#initialize(config, url) ⇒ SingleUrlScope
Returns a new instance of SingleUrlScope.
7 8 9 10 |
# File 'lib/webspicy/configuration/single_url.rb', line 7 def initialize(config, url) super(config) @url = url end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
11 12 13 |
# File 'lib/webspicy/configuration/single_url.rb', line 11 def url @url end |
Instance Method Details
#each_specification {|Webspicy.specification(spec, nil, self)| ... } ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/webspicy/configuration/single_url.rb', line 13 def each_specification(&bl) return enum_for(:each_specification) unless block_given? spec = " ---\n name: |-\n Default specification\n url: |-\n \#{url}\n\n services:\n - method: |-\n GET\n description: |-\n Getting \#{url}\n\n input_schema: |-\n Any\n output_schema: |-\n Any\n error_schema: |-\n Any\n\n examples:\n - description: |-\n it returns a 200\n params: {}\n expected:\n status: 200\n YML\n Webspicy.debug(spec)\n yield Webspicy.specification(spec, nil, self)\nend\n" |