occi-core 4.3.6 → 5.0.0.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.fasterer.yml +3 -0
- data/.gitignore +9 -16
- data/.rspec +1 -1
- data/.rubocop.yml +69 -0
- data/.travis.yml +27 -0
- data/AUTHORS +8 -6
- data/CHANGELOG.md +0 -0
- data/Gemfile +1 -1
- data/LICENSE +1 -1
- data/README.md +25 -170
- data/Rakefile +25 -17
- data/examples/initialize_model.rb +10 -0
- data/examples/parse_action_instance_json.rb +15 -0
- data/examples/parse_action_instance_text.rb +15 -0
- data/examples/parse_categories_json.rb +15 -0
- data/examples/parse_categories_text.rb +15 -0
- data/examples/parse_instance_json.rb +15 -0
- data/examples/parse_instance_text.rb +15 -0
- data/examples/parse_model_json.rb +9 -0
- data/examples/parse_model_text.rb +9 -0
- data/examples/render_action_instance_json.rb +17 -0
- data/examples/render_action_instance_text.rb +17 -0
- data/examples/render_instance_json.rb +20 -0
- data/examples/render_instance_text.rb +20 -0
- data/examples/render_model_json.rb +12 -0
- data/examples/render_model_text.rb +12 -0
- data/examples/rendering/action_instance.json +6 -0
- data/examples/rendering/action_instance.txt +2 -0
- data/examples/rendering/categories.json +78 -0
- data/examples/rendering/categories.txt +4 -0
- data/examples/rendering/instance.json +70 -0
- data/examples/rendering/instance.txt +12 -0
- data/examples/rendering/model.alt.json +1716 -0
- data/examples/rendering/model.json +785 -0
- data/examples/rendering/model.txt +68 -0
- data/lib/occi/core/action.rb +12 -26
- data/lib/occi/core/action_instance.rb +109 -65
- data/lib/occi/core/attribute.rb +136 -0
- data/lib/occi/core/attribute_definition.rb +269 -0
- data/lib/occi/core/category.rb +110 -83
- data/lib/occi/core/collection.rb +255 -0
- data/lib/occi/core/constants.rb +14 -0
- data/lib/occi/core/entity.rb +301 -195
- data/lib/occi/core/errors/.gitkeep +0 -0
- data/lib/occi/core/errors/attribute_definition_error.rb +11 -0
- data/lib/occi/core/errors/attribute_validation_error.rb +13 -0
- data/lib/occi/core/errors/category_validation_error.rb +13 -0
- data/lib/occi/core/errors/collection_lookup_error.rb +11 -0
- data/lib/occi/core/errors/instance_validation_error.rb +13 -0
- data/lib/occi/core/errors/mandatory_argument_error.rb +11 -0
- data/lib/occi/core/errors/model_lookup_error.rb +11 -0
- data/lib/occi/core/errors/parser_error.rb +11 -0
- data/lib/occi/core/errors/parsing_error.rb +11 -0
- data/lib/occi/core/errors/renderer_error.rb +11 -0
- data/lib/occi/core/errors/rendering_error.rb +11 -0
- data/lib/occi/core/errors/validation_error.rb +11 -0
- data/lib/occi/core/errors.rb +9 -0
- data/lib/occi/core/helpers/.gitkeep +0 -0
- data/lib/occi/core/helpers/argument_validator.rb +27 -0
- data/lib/occi/core/helpers/attributes_accessor.rb +22 -0
- data/lib/occi/core/helpers/error_handler.rb +29 -0
- data/lib/occi/core/helpers/hash_dereferencer.rb +149 -0
- data/lib/occi/core/helpers/identifier_validator.rb +135 -0
- data/lib/occi/core/helpers/instance_attribute_resetter.rb +131 -0
- data/lib/occi/core/helpers/instance_attributes_accessor.rb +30 -0
- data/lib/occi/core/helpers/locatable.rb +40 -0
- data/lib/occi/core/helpers/parser_dereferencer.rb +96 -0
- data/lib/occi/core/helpers/raw_json_parser.rb +18 -0
- data/lib/occi/core/helpers/renderable.rb +93 -0
- data/lib/occi/core/helpers/yaml_summoner.rb +44 -0
- data/lib/occi/core/helpers.rb +13 -0
- data/lib/occi/core/instance_builder.rb +162 -0
- data/lib/occi/core/kind.rb +100 -132
- data/lib/occi/core/link.rb +47 -72
- data/lib/occi/core/mixin.rb +76 -61
- data/lib/occi/core/model.rb +341 -0
- data/lib/occi/core/parsers/.gitkeep +0 -0
- data/lib/occi/core/parsers/base_parser.rb +168 -0
- data/lib/occi/core/parsers/json/.gitkeep +0 -0
- data/lib/occi/core/parsers/json/action_instance.rb +36 -0
- data/lib/occi/core/parsers/json/category.rb +113 -0
- data/lib/occi/core/parsers/json/entity.rb +156 -0
- data/lib/occi/core/parsers/json/validator/.gitkeep +0 -0
- data/lib/occi/core/parsers/json/validator/action-instance.json +3 -0
- data/lib/occi/core/parsers/json/validator/entity-collection.json +3 -0
- data/lib/occi/core/parsers/json/validator/link-collection.json +3 -0
- data/lib/occi/core/parsers/json/validator/link.json +3 -0
- data/lib/occi/core/parsers/json/validator/locations.json +3 -0
- data/lib/occi/core/parsers/json/validator/mixin-collection.json +3 -0
- data/lib/occi/core/parsers/json/validator/model.json +3 -0
- data/lib/occi/core/parsers/json/validator/occi-schema.json +277 -0
- data/lib/occi/core/parsers/json/validator/resource-collection.json +3 -0
- data/lib/occi/core/parsers/json/validator/resource.json +3 -0
- data/lib/occi/core/parsers/json/validator.rb +87 -0
- data/lib/occi/core/parsers/json_parser.rb +128 -0
- data/lib/occi/core/parsers/text/.gitkeep +0 -0
- data/lib/occi/core/parsers/text/category.rb +183 -0
- data/lib/occi/core/parsers/text/constants.rb +89 -0
- data/lib/occi/core/parsers/text/entity.rb +257 -0
- data/lib/occi/core/parsers/text/location.rb +48 -0
- data/lib/occi/core/parsers/text_parser.rb +257 -0
- data/lib/occi/core/parsers.rb +18 -0
- data/lib/occi/core/renderer_factory.rb +213 -0
- data/lib/occi/core/renderers/.gitkeep +0 -0
- data/lib/occi/core/renderers/base_renderer.rb +81 -0
- data/lib/occi/core/renderers/json/.gitkeep +0 -0
- data/lib/occi/core/renderers/json/action_instance.rb +24 -0
- data/lib/occi/core/renderers/json/attributes.rb +50 -0
- data/lib/occi/core/renderers/json/base.rb +46 -0
- data/lib/occi/core/renderers/json/category.rb +85 -0
- data/lib/occi/core/renderers/json/collection.rb +52 -0
- data/lib/occi/core/renderers/json/instance.rb +39 -0
- data/lib/occi/core/renderers/json/link.rb +48 -0
- data/lib/occi/core/renderers/json/model.rb +26 -0
- data/lib/occi/core/renderers/json/resource.rb +27 -0
- data/lib/occi/core/renderers/json_renderer.rb +72 -0
- data/lib/occi/core/renderers/text/.gitkeep +0 -0
- data/lib/occi/core/renderers/text/action_instance.rb +36 -0
- data/lib/occi/core/renderers/text/attributes.rb +87 -0
- data/lib/occi/core/renderers/text/base.rb +82 -0
- data/lib/occi/core/renderers/text/category.rb +183 -0
- data/lib/occi/core/renderers/text/collection.rb +65 -0
- data/lib/occi/core/renderers/text/instance.rb +44 -0
- data/lib/occi/core/renderers/text/link.rb +40 -0
- data/lib/occi/core/renderers/text/model.rb +41 -0
- data/lib/occi/core/renderers/text/resource.rb +109 -0
- data/lib/occi/core/renderers/text_renderer.rb +72 -0
- data/lib/occi/core/renderers.rb +20 -0
- data/lib/occi/core/resource.rb +93 -57
- data/lib/occi/core/utils/.gitkeep +0 -0
- data/lib/occi/core/version.rb +17 -0
- data/lib/occi/core/warehouse/actions/.gitkeep +0 -0
- data/lib/occi/core/warehouse/actions/attributes/.gitkeep +0 -0
- data/lib/occi/core/warehouse/kinds/.gitkeep +0 -0
- data/lib/occi/core/warehouse/kinds/attributes/.gitkeep +0 -0
- data/lib/occi/core/warehouse/kinds/attributes/occi.core.id.yml +7 -0
- data/lib/occi/core/warehouse/kinds/attributes/occi.core.source.yml +7 -0
- data/lib/occi/core/warehouse/kinds/attributes/occi.core.summary.yml +7 -0
- data/lib/occi/core/warehouse/kinds/attributes/occi.core.target.yml +7 -0
- data/lib/occi/core/warehouse/kinds/attributes/occi.core.title.yml +7 -0
- data/lib/occi/core/warehouse/kinds/entity.yml +10 -0
- data/lib/occi/core/warehouse/kinds/link.yml +10 -0
- data/lib/occi/core/warehouse/kinds/resource.yml +9 -0
- data/lib/occi/core/warehouse/mixins/.gitkeep +0 -0
- data/lib/occi/core/warehouse/mixins/attributes/.gitkeep +0 -0
- data/lib/occi/core/warehouse.rb +115 -0
- data/lib/occi/core.rb +59 -23
- data/lib/occi/infrastructure/compute.rb +5 -122
- data/lib/occi/infrastructure/constants.rb +25 -0
- data/lib/occi/infrastructure/instance_builder.rb +24 -0
- data/lib/occi/infrastructure/mixins/.gitkeep +0 -0
- data/lib/occi/infrastructure/mixins/os_tpl.rb +19 -0
- data/lib/occi/infrastructure/mixins/resource_tpl.rb +19 -0
- data/lib/occi/infrastructure/mixins.rb +12 -0
- data/lib/occi/infrastructure/model.rb +27 -0
- data/lib/occi/infrastructure/network.rb +5 -104
- data/lib/occi/infrastructure/networkinterface.rb +5 -100
- data/lib/occi/infrastructure/storage.rb +5 -59
- data/lib/occi/infrastructure/storagelink.rb +5 -54
- data/lib/occi/infrastructure/version.rb +5 -0
- data/lib/occi/infrastructure/warehouse/actions/.gitkeep +0 -0
- data/lib/occi/infrastructure/warehouse/actions/attributes/.gitkeep +0 -0
- data/lib/occi/infrastructure/warehouse/actions/compute_restart.yml +12 -0
- data/lib/occi/infrastructure/warehouse/actions/compute_save.yml +19 -0
- data/lib/occi/infrastructure/warehouse/actions/compute_start.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/compute_stop.yml +12 -0
- data/lib/occi/infrastructure/warehouse/actions/compute_suspend.yml +12 -0
- data/lib/occi/infrastructure/warehouse/actions/network_down.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/network_up.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/networkinterface_down.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/networkinterface_up.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/storage_backup.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/storage_offline.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/storage_online.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/storage_resize.yml +12 -0
- data/lib/occi/infrastructure/warehouse/actions/storage_snapshot.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/storagelink_offline.yml +4 -0
- data/lib/occi/infrastructure/warehouse/actions/storagelink_online.yml +4 -0
- data/lib/occi/infrastructure/warehouse/kinds/.gitkeep +0 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/.gitkeep +0 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.architecture.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.cores.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.hostname.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.memory.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.speed.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.compute.state.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.network.label.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.network.state.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.network.vlan.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.networkinterface.interface.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.networkinterface.mac.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.networkinterface.state.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storage.size.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storage.state.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storagelink.deviceid.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storagelink.mountpoint.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/attributes/occi.storagelink.state.yml +7 -0
- data/lib/occi/infrastructure/warehouse/kinds/compute.yml +19 -0
- data/lib/occi/infrastructure/warehouse/kinds/network.yml +13 -0
- data/lib/occi/infrastructure/warehouse/kinds/networkinterface.yml +13 -0
- data/lib/occi/infrastructure/warehouse/kinds/storage.yml +15 -0
- data/lib/occi/infrastructure/warehouse/kinds/storagelink.yml +13 -0
- data/lib/occi/infrastructure/warehouse/mixins/.gitkeep +0 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/.gitkeep +0 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/occi.network.address.yml +7 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/occi.network.allocation.yml +7 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/occi.network.gateway.yml +7 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/occi.networkinterface.address.yml +7 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/occi.networkinterface.allocation.yml +7 -0
- data/lib/occi/infrastructure/warehouse/mixins/attributes/occi.networkinterface.gateway.yml +7 -0
- data/lib/occi/infrastructure/warehouse/mixins/ipnetwork.yml +11 -0
- data/lib/occi/infrastructure/warehouse/mixins/ipnetworkinterface.yml +11 -0
- data/lib/occi/infrastructure/warehouse.rb +20 -0
- data/lib/occi/infrastructure-ext.rb +35 -0
- data/lib/occi/infrastructure.rb +34 -19
- data/lib/occi/infrastructure_ext/constants.rb +20 -0
- data/lib/occi/infrastructure_ext/instance_builder.rb +22 -0
- data/lib/occi/infrastructure_ext/ipreservation.rb +9 -0
- data/lib/occi/infrastructure_ext/mixins/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/mixins/availability_zone.rb +19 -0
- data/lib/occi/infrastructure_ext/mixins.rb +12 -0
- data/lib/occi/infrastructure_ext/model.rb +26 -0
- data/lib/occi/infrastructure_ext/securitygroup.rb +9 -0
- data/lib/occi/infrastructure_ext/securitygrouplink.rb +9 -0
- data/lib/occi/infrastructure_ext/version.rb +5 -0
- data/lib/occi/infrastructure_ext/warehouse/actions/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/warehouse/actions/attributes/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/warehouse/actions/ipreservation_down.yml +4 -0
- data/lib/occi/infrastructure_ext/warehouse/actions/ipreservation_up.yml +4 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.ipreservation.address.yml +7 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.ipreservation.state.yml +7 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.ipreservation.used.yml +7 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.securitygroup.rules.yml +7 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.securitygroup.state.yml +7 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/attributes/occi.securitygrouplink.state.yml +7 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/ipreservation.yml +13 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/securitygroup.yml +9 -0
- data/lib/occi/infrastructure_ext/warehouse/kinds/securitygrouplink.yml +8 -0
- data/lib/occi/infrastructure_ext/warehouse/mixins/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/warehouse/mixins/attributes/.gitkeep +0 -0
- data/lib/occi/infrastructure_ext/warehouse.rb +20 -0
- data/lib/occi/monkey_island/boolean.rb +6 -0
- data/lib/occi/monkey_island/hash.rb +4 -0
- data/occi-core.gemspec +26 -26
- metadata +312 -243
- data/.yardopts +0 -1
- data/config/occi.yml +0 -4
- data/lib/occi/collection.rb +0 -265
- data/lib/occi/core/actions.rb +0 -21
- data/lib/occi/core/attributes.rb +0 -411
- data/lib/occi/core/categories.rb +0 -64
- data/lib/occi/core/dependencies.rb +0 -7
- data/lib/occi/core/entities.rb +0 -48
- data/lib/occi/core/kinds.rb +0 -22
- data/lib/occi/core/links.rb +0 -37
- data/lib/occi/core/mixins.rb +0 -37
- data/lib/occi/core/properties.rb +0 -108
- data/lib/occi/core/resources.rb +0 -14
- data/lib/occi/errors/attribute_definitions_converted_error.rb +0 -5
- data/lib/occi/errors/attribute_missing_error.rb +0 -5
- data/lib/occi/errors/attribute_name_invalid_error.rb +0 -5
- data/lib/occi/errors/attribute_not_defined_error.rb +0 -5
- data/lib/occi/errors/attribute_property_type_error.rb +0 -5
- data/lib/occi/errors/attribute_type_error.rb +0 -5
- data/lib/occi/errors/category_not_defined_error.rb +0 -5
- data/lib/occi/errors/kind_not_defined_error.rb +0 -5
- data/lib/occi/errors/parser_input_error.rb +0 -5
- data/lib/occi/errors/parser_type_error.rb +0 -5
- data/lib/occi/errors.rb +0 -1
- data/lib/occi/extensions/hashie.rb +0 -25
- data/lib/occi/helpers/comparators/action_instance.rb +0 -22
- data/lib/occi/helpers/comparators/attributes.rb +0 -22
- data/lib/occi/helpers/comparators/categories.rb +0 -22
- data/lib/occi/helpers/comparators/category.rb +0 -22
- data/lib/occi/helpers/comparators/collection.rb +0 -40
- data/lib/occi/helpers/comparators/entities.rb +0 -22
- data/lib/occi/helpers/comparators/entity.rb +0 -22
- data/lib/occi/helpers/comparators/properties.rb +0 -26
- data/lib/occi/helpers/comparators.rb +0 -1
- data/lib/occi/helpers/inspect.rb +0 -12
- data/lib/occi/infrastructure/network/ipnetwork.rb +0 -28
- data/lib/occi/infrastructure/networkinterface/ipnetworkinterface.rb +0 -28
- data/lib/occi/infrastructure/os_tpl.rb +0 -20
- data/lib/occi/infrastructure/resource_tpl.rb +0 -20
- data/lib/occi/log.rb +0 -71
- data/lib/occi/model.rb +0 -87
- data/lib/occi/parser/json.rb +0 -38
- data/lib/occi/parser/text/constants.rb +0 -89
- data/lib/occi/parser/text.rb +0 -280
- data/lib/occi/parser.rb +0 -144
- data/lib/occi/settings.rb +0 -10
- data/lib/occi/version.rb +0 -3
- data/lib/occi-core.rb +0 -53
- data/spec/helpers/to_plain.rb +0 -39
- data/spec/helpers/yaml_hash.rb +0 -32
- data/spec/occi/collection_samples/collection1.json +0 -1
- data/spec/occi/collection_samples/directory2/collection2.json +0 -1
- data/spec/occi/collection_spec.rb +0 -1003
- data/spec/occi/core/action_instance_spec.rb +0 -317
- data/spec/occi/core/action_spec.rb +0 -71
- data/spec/occi/core/attributes_spec.rb +0 -665
- data/spec/occi/core/categories_spec.rb +0 -28
- data/spec/occi/core/category_spec.rb +0 -216
- data/spec/occi/core/entities_spec.rb +0 -160
- data/spec/occi/core/entity_spec.rb +0 -374
- data/spec/occi/core/kind_spec.rb +0 -182
- data/spec/occi/core/link_spec.rb +0 -52
- data/spec/occi/core/links_spec.rb +0 -132
- data/spec/occi/core/mixin_spec.rb +0 -38
- data/spec/occi/core/mixins_spec.rb +0 -107
- data/spec/occi/core/properties_spec.rb +0 -171
- data/spec/occi/core/resource_spec.rb +0 -42
- data/spec/occi/core_spec.rb +0 -12
- data/spec/occi/infrastructure/compute_spec.rb +0 -229
- data/spec/occi/infrastructure/network_spec.rb +0 -96
- data/spec/occi/infrastructure/networkinterface_spec.rb +0 -96
- data/spec/occi/infrastructure/storage_spec.rb +0 -33
- data/spec/occi/infrastructure/storagelink_spec.rb +0 -45
- data/spec/occi/log_spec.rb +0 -117
- data/spec/occi/model_spec.rb +0 -256
- data/spec/occi/parser/json_samples/test.json +0 -49
- data/spec/occi/parser/text_samples/occi_categories.body_plain.expected +0 -2
- data/spec/occi/parser/text_samples/occi_categories.expected +0 -2
- data/spec/occi/parser/text_samples/occi_categories.parse_headers.expected +0 -2
- data/spec/occi/parser/text_samples/occi_categories.text +0 -2
- data/spec/occi/parser/text_samples/occi_compute_rocci_server.expected +0 -11
- data/spec/occi/parser/text_samples/occi_compute_rocci_server.text +0 -10
- data/spec/occi/parser/text_samples/occi_link_resource_instance.body_plain.expected +0 -7
- data/spec/occi/parser/text_samples/occi_link_resource_instance.expected +0 -7
- data/spec/occi/parser/text_samples/occi_link_resource_instance.parse.expected +0 -7
- data/spec/occi/parser/text_samples/occi_link_resource_instance.text +0 -7
- data/spec/occi/parser/text_samples/occi_link_simple.expected +0 -7
- data/spec/occi/parser/text_samples/occi_link_simple.text +0 -1
- data/spec/occi/parser/text_samples/occi_link_w_attributes.expected +0 -7
- data/spec/occi/parser/text_samples/occi_link_w_attributes.text +0 -7
- data/spec/occi/parser/text_samples/occi_link_w_category.expected +0 -7
- data/spec/occi/parser/text_samples/occi_link_w_category.text +0 -3
- data/spec/occi/parser/text_samples/occi_model_categories.expected +0 -3
- data/spec/occi/parser/text_samples/occi_model_rocci_server.text +0 -51
- data/spec/occi/parser/text_samples/occi_network_rocci_server.body_plain.expected +0 -11
- data/spec/occi/parser/text_samples/occi_network_rocci_server.expected +0 -11
- data/spec/occi/parser/text_samples/occi_network_rocci_server.resource.header.expected +0 -9
- data/spec/occi/parser/text_samples/occi_network_rocci_server.resource.rack.expected +0 -9
- data/spec/occi/parser/text_samples/occi_network_rocci_server.text +0 -11
- data/spec/occi/parser/text_samples/occi_resource_custom_class_w_attributes.parse.expected +0 -15
- data/spec/occi/parser/text_samples/occi_resource_custom_class_w_attributes.text +0 -15
- data/spec/occi/parser/text_samples/occi_resource_w_attributes.text +0 -11
- data/spec/occi/parser/text_samples/occi_resource_w_inline_links.expected +0 -1
- data/spec/occi/parser/text_samples/occi_resource_w_inline_links.text +0 -16
- data/spec/occi/parser/text_samples/occi_resource_w_inline_links_only.text +0 -13
- data/spec/occi/parser/text_samples/occi_storage_rocci_server.expected +0 -9
- data/spec/occi/parser/text_samples/occi_storage_rocci_server.text +0 -9
- data/spec/occi/parser/text_spec.rb +0 -320
- data/spec/occi/parser_spec.rb +0 -259
- data/spec/occi-core_spec.rb +0 -31
- data/spec/spec_helper.rb +0 -18
data/spec/occi/parser_spec.rb
DELETED
@@ -1,259 +0,0 @@
|
|
1
|
-
module Occi
|
2
|
-
describe "Parser" do
|
3
|
-
|
4
|
-
context ".parse" do
|
5
|
-
|
6
|
-
context "render->parse tests" do
|
7
|
-
let(:collection){ Occi::Collection.new }
|
8
|
-
let(:resource){ collection.resources.create }
|
9
|
-
let(:link){ link = resource.links.create
|
10
|
-
link.id = UUIDTools::UUID.random_create.to_s
|
11
|
-
link.target = 'http://example.com/resource/aee5acf5-71de-40b0-bd1c-2284658bfd0e'
|
12
|
-
link.source = resource
|
13
|
-
link
|
14
|
-
}
|
15
|
-
|
16
|
-
context "resources from OCCI messages with text/plain MIME type" do
|
17
|
-
let(:rendered_collection){ collection.to_text }
|
18
|
-
|
19
|
-
it 'parses self-generated collection with resources' do
|
20
|
-
expect(Occi::Parser.parse('text/plain', rendered_collection).to_json).to eql collection.to_json
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'parses self-generated collection with added attributes' do
|
24
|
-
resource.id = UUIDTools::UUID.random_create.to_s
|
25
|
-
resource.title = 'title'
|
26
|
-
expect(Occi::Parser.parse('text/plain', rendered_collection).to_json).to eql collection.to_json
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'parses self-generated collection with added mixin' do
|
30
|
-
resource.mixins << Occi::Core::Mixin.new
|
31
|
-
expect(Occi::Parser.parse('text/plain', rendered_collection).to_json).to eql collection.to_json
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'parses self-generated collection with added link' do
|
35
|
-
collection << link
|
36
|
-
expect(Occi::Parser.parse('text/plain', rendered_collection).to_json).to eql collection.to_json
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context 'resources from OCCI messages with text/occi MIME type' do
|
41
|
-
let(:rendered_collection){ collection.to_header }
|
42
|
-
let(:real_world_example_model) {
|
43
|
-
{"Category" => "compute;scheme=\"http://schemas.ogf.org/occi/infrastructure#\";class=\"kind\";location=\"/compute/\",console;scheme=\"http://schemas.ogf.org/occi/infrastructure/compute#\";class=\"kind\";location=\"/console/\",entity;scheme=\"http://schemas.ogf.org/occi/core#\";class=\"kind\";location=\"/entity/\",link;scheme=\"http://schemas.ogf.org/occi/core#\";class=\"kind\";location=\"/link/\",network;scheme=\"http://schemas.ogf.org/occi/infrastructure#\";class=\"kind\";location=\"/network/\",networkinterface;scheme=\"http://schemas.ogf.org/occi/infrastructure#\";class=\"kind\";location=\"/networkinterface/\",resource;scheme=\"http://schemas.ogf.org/occi/core#\";class=\"kind\";location=\"/resource/\",storage;scheme=\"http://schemas.ogf.org/occi/infrastructure#\";class=\"kind\";location=\"/storage/\",storagelink;scheme=\"http://schemas.ogf.org/occi/infrastructure#\";class=\"kind\";location=\"/storagelink/\",compute;scheme=\"http://opennebula.org/occi/infrastructure#\";class=\"mixin\";location=\"/mixin/compute/\",extra_large;scheme=\"http://sitespecific.cesnet.cz/occi/infrastructure/resource_tpl#\";class=\"mixin\";location=\"/mixin/extra_large/\",ipnetwork;scheme=\"http://schemas.ogf.org/occi/infrastructure/network#\";class=\"mixin\";location=\"/mixin/ipnetwork/\",ipnetworkinterface;scheme=\"http://schemas.ogf.org/occi/infrastructure/networkinterface#\";class=\"mixin\";location=\"/mixin/ipnetworkinterface/\",large;scheme=\"http://sitespecific.cesnet.cz/occi/infrastructure/resource_tpl#\";class=\"mixin\";location=\"/mixin/large/\",medium;scheme=\"http://sitespecific.cesnet.cz/occi/infrastructure/resource_tpl#\";class=\"mixin\";location=\"/mixin/medium/\",network;scheme=\"http://opennebula.org/occi/infrastructure#\";class=\"mixin\";location=\"/mixin/network/\",networkinterface;scheme=\"http://opennebula.org/occi/infrastructure#\";class=\"mixin\";location=\"/mixin/networkinterface/\",os_tpl;scheme=\"http://schemas.ogf.org/occi/infrastructure#\";class=\"mixin\";location=\"/mixin/os_tpl/\",public_key;scheme=\"http://schemas.openstack.org/instance/credentials#\";class=\"mixin\";location=\"/mixin/public_key/\",resource_tpl;scheme=\"http://schemas.ogf.org/occi/infrastructure#\";class=\"mixin\";location=\"/mixin/resource_tpl/\",small;scheme=\"http://sitespecific.cesnet.cz/occi/infrastructure/resource_tpl#\";class=\"mixin\";location=\"/mixin/small/\",storage;scheme=\"http://opennebula.org/occi/infrastructure#\";class=\"mixin\";location=\"/mixin/storage/\",storagelink;scheme=\"http://opennebula.org/occi/infrastructure#\";class=\"mixin\";location=\"/mixin/storagelink/\",user_data;scheme=\"http://schemas.openstack.org/compute/instance#\";class=\"mixin\";location=\"/mixin/user_data/\",uuid_egi_compss_62;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_egi_compss_62/\",uuid_egi_compss_cesnet_57;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_egi_compss_cesnet_57/\",uuid_egi_compss_debian_7_0_x86_64_0001_cloud_dukan_74;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_egi_compss_debian_7_0_x86_64_0001_cloud_dukan_74/\",uuid_egi_sl6goldenimage_cesnet_50;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_egi_sl6goldenimage_cesnet_50/\",uuid_egi_test_compss_69;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_egi_test_compss_69/\",uuid_esa_sl64_cesnet_58;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_esa_sl64_cesnet_58/\",uuid_generic_vm_54;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_generic_vm_54/\",uuid_generic_www_60;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_generic_www_60/\",uuid_genericcloud_debian_7_0_x86_64_0001_cloud_dukan_71;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_genericcloud_debian_7_0_x86_64_0001_cloud_dukan_71/\",uuid_genericcloud_scilinux_6_5_x86_64_0001_cloud_dukan_73;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_genericcloud_scilinux_6_5_x86_64_0001_cloud_dukan_73/\",uuid_genericcloud_ubuntu_12_04_lts_x86_64_0001_cloud_dukan_72;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_genericcloud_ubuntu_12_04_lts_x86_64_0001_cloud_dukan_72/\",uuid_monitoring_20;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_monitoring_20/\",uuid_octave_55;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_octave_55/\",uuid_r_56;scheme=\"http://occi.localhost/occi/infrastructure/os_tpl#\";class=\"mixin\";location=\"/mixin/uuid_r_56/\""}
|
44
|
-
}
|
45
|
-
|
46
|
-
it 'parses self-generated collection with resources' do
|
47
|
-
expect(Occi::Parser.parse('text/occi', '', false, Occi::Core::Resource, rendered_collection).to_header).to eql rendered_collection
|
48
|
-
end
|
49
|
-
|
50
|
-
it 'parses self-generated collection with added attributes' do
|
51
|
-
resource.id = UUIDTools::UUID.random_create.to_s
|
52
|
-
resource.title = 'title'
|
53
|
-
expect(Occi::Parser.parse('text/occi', '', false, Occi::Core::Resource, rendered_collection).to_header).to eql rendered_collection
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'parses self-generated collection with added mixin' do
|
57
|
-
resource.mixins << Occi::Core::Mixin.new('http://schemas.ogf.org/occi/mymixins#', 'test')
|
58
|
-
expect(Occi::Parser.parse('text/occi', '', false, Occi::Core::Resource, rendered_collection).to_header).to eql rendered_collection
|
59
|
-
end
|
60
|
-
|
61
|
-
it 'parses self-generated collection with added link' do
|
62
|
-
collection << link
|
63
|
-
parsed = Occi::Parser.parse('text/occi', '', false, Occi::Core::Resource, rendered_collection)
|
64
|
-
expect(parsed.to_header).to eql rendered_collection
|
65
|
-
expect(parsed.resources.first.links).not_to be_empty
|
66
|
-
end
|
67
|
-
|
68
|
-
it 'parses a real-world example of the OCCI model' do
|
69
|
-
expect(Occi::Parser.parse('text/occi', '', true, Occi::Core::Resource, real_world_example_model).to_header.to_hash).to eql(real_world_example_model)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
context 'resources from OCCI messages with application/occi+json MIME type' do
|
74
|
-
let(:rendered_collection){ collection.to_json }
|
75
|
-
it 'parses self-generated collection with resources' do
|
76
|
-
expect(Occi::Parser.parse('application/occi+json', rendered_collection)).to eql collection
|
77
|
-
end
|
78
|
-
|
79
|
-
it 'parses self-generated collection with added attributes' do
|
80
|
-
resource.id = UUIDTools::UUID.random_create.to_s
|
81
|
-
resource.title = 'title'
|
82
|
-
expect(Occi::Parser.parse('application/occi+json', rendered_collection)).to eql collection
|
83
|
-
end
|
84
|
-
|
85
|
-
it 'parses self-generated collection with added mixin' do
|
86
|
-
resource.mixins << Occi::Core::Mixin.new
|
87
|
-
expect(Occi::Parser.parse('application/occi+json', rendered_collection)).to eql collection
|
88
|
-
end
|
89
|
-
|
90
|
-
it 'parses self-generated collection with added link' #do #Already deactivated in previous version
|
91
|
-
# collection << link
|
92
|
-
# expect(Occi::Parser.parse('application/occi+json', rendered_collection)).to eql collection
|
93
|
-
# end
|
94
|
-
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
it 'copes with non-existent MIME-type' do
|
99
|
-
expect{ collection = Occi::Parser.parse('application/notexist', 'X-OCCI-Location: http://example.com:8090/a/b/vm1"') }.to raise_error(Occi::Errors::ParserTypeError)
|
100
|
-
end
|
101
|
-
|
102
|
-
it 'copes with type text/uri-list' do
|
103
|
-
expect{ collection = Occi::Parser.parse('text/uri-list', 'http://example.com:8090/a/b/vm1"') }.to raise_error(Occi::Errors::ParserTypeError)
|
104
|
-
end
|
105
|
-
|
106
|
-
it 'skips type text/occi in body' do
|
107
|
-
collection = Occi::Parser.parse('text/occi', 'Category: TERM;scheme="http://a.a/a#";class=kind')
|
108
|
-
expected = Occi::Collection.new
|
109
|
-
expect(collection).to eql expected
|
110
|
-
end
|
111
|
-
|
112
|
-
end
|
113
|
-
|
114
|
-
context '.parse_headers' do
|
115
|
-
let(:resource_in_headers) do
|
116
|
-
resource = {}
|
117
|
-
resource['Category'] = "network;scheme=\"http://schemas.ogf.org/occi/infrastructure#\";class=\"kind\",network;scheme=\"http://opennebula.org/occi/infrastructure#\";class=\"mixin\",ipnetwork;scheme=\"http://schemas.ogf.org/occi/infrastructure#\";class=\"mixin\""
|
118
|
-
resource['X-OCCI-Attribute'] = "occi.core.id=\"e4bd81c4-adda-5626-840d-39bb7959db97\",occi.core.title=\"monitoring\",occi.network.address=\"192.168.254.0\",occi.network.allocation=\"dynamic\",occi.network.state=\"active\",org.opennebula.network.id=\"6\",org.opennebula.network.bridge=\"xenbr0\",org.opennebula.network.vlan=\"NO\""
|
119
|
-
resource
|
120
|
-
end
|
121
|
-
|
122
|
-
let(:rack_resource_in_headers) do
|
123
|
-
resource = {}
|
124
|
-
resource['HTTP_CATEGORY'] = resource_in_headers['Category']
|
125
|
-
resource['HTTP_X_OCCI_ATTRIBUTE'] = resource_in_headers['X-OCCI-Attribute']
|
126
|
-
resource
|
127
|
-
end
|
128
|
-
|
129
|
-
it 'parses categories' do
|
130
|
-
categories_string = File.open("spec/occi/parser/text_samples/occi_categories.text", "rt").read
|
131
|
-
categories = Occi::Parser.parse('text/plain', categories_string, true)
|
132
|
-
expected = File.open("spec/occi/parser/text_samples/occi_categories.parse_headers.expected", "rt").read
|
133
|
-
expect(categories.to_text).to eql expected
|
134
|
-
end
|
135
|
-
|
136
|
-
it 'parses resources from headers' do
|
137
|
-
resource = Occi::Parser.parse('text/occi', '', false, Occi::Core::Resource, resource_in_headers)
|
138
|
-
expected = File.open("spec/occi/parser/text_samples/occi_network_rocci_server.resource.header.expected", "rt").read.chomp
|
139
|
-
expect(resource.to_text).to eql expected
|
140
|
-
end
|
141
|
-
|
142
|
-
it 'parses resources from rack-compliant headers' do
|
143
|
-
resource = Occi::Parser.parse('text/occi', '', false, Occi::Core::Resource, rack_resource_in_headers)
|
144
|
-
expected = File.open("spec/occi/parser/text_samples/occi_network_rocci_server.resource.rack.expected", "rt").read.chomp
|
145
|
-
expect(resource.to_text).to eql expected
|
146
|
-
end
|
147
|
-
|
148
|
-
it 'parses link' do
|
149
|
-
link_string = File.open("spec/occi/parser/text_samples/occi_link_resource_instance.text", "rt").read
|
150
|
-
link = Occi::Parser.parse('text/plain', link_string, false, Occi::Core::Link)
|
151
|
-
expected = File.open("spec/occi/parser/text_samples/occi_link_resource_instance.parse.expected", "rt").read.chomp
|
152
|
-
expect(link.to_text).to eql expected
|
153
|
-
end
|
154
|
-
|
155
|
-
it 'fails gracefully for unknown entity type' do
|
156
|
-
resource_string = File.open("spec/occi/parser/text_samples/occi_network_rocci_server.text", "rt").read
|
157
|
-
expect{ Occi::Parser.parse('text/plain', resource_string, false, Occi::Core::Action) }.to raise_error(Occi::Errors::ParserTypeError)
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
|
-
context '.locations' do
|
162
|
-
let(:expected){ ["http://example.com:8090/a/b/vm1", "http://example.com:8090/a/b/vm2"] }
|
163
|
-
let(:single_expected){ ["http://example.com:8090/a/b/vm1"] }
|
164
|
-
it 'parses single location from headers' do
|
165
|
-
header = Hashie::Mash.new
|
166
|
-
header['X-OCCI-Location'] = 'http://example.com:8090/a/b/vm1'
|
167
|
-
location = Occi::Parser.locations("", "", header)
|
168
|
-
expect(location).to eql single_expected
|
169
|
-
end
|
170
|
-
|
171
|
-
it 'parses multiple locations from headers' do
|
172
|
-
header = Hashie::Mash.new
|
173
|
-
header['X-OCCI-Location'] = "http://example.com:8090/a/b/vm1,http://example.com:8090/a/b/vm2"
|
174
|
-
location = Occi::Parser.locations("", "", header)
|
175
|
-
expect(location).to eql expected
|
176
|
-
end
|
177
|
-
|
178
|
-
it 'parses locations from headers, skipping attributes' do
|
179
|
-
header = Hashie::Mash.new
|
180
|
-
header['X-OCCI-Location'] = "http://example.com:8090/a/b/vm1,http://example.com:8090/a/b/vm2"
|
181
|
-
header['X-OCCI-Attribute'] = "occi.core.title=\"test\""
|
182
|
-
location = Occi::Parser.locations("", "", header)
|
183
|
-
expect(location).to eql expected
|
184
|
-
end
|
185
|
-
|
186
|
-
it 'parses multiple locations from an URI list' do
|
187
|
-
locations_text = "http://example.com:8090/a/b/vm1\nhttp://example.com:8090/a/b/vm2"
|
188
|
-
location = Occi::Parser.locations("text/uri-list", locations_text, {})
|
189
|
-
expect(location).to eql expected
|
190
|
-
end
|
191
|
-
|
192
|
-
it 'parses multiple locations from plain text' do
|
193
|
-
locations_text = "X-OCCI-Location: http://example.com:8090/a/b/vm1\nX-OCCI-Location: http://example.com:8090/a/b/vm2"
|
194
|
-
location = Occi::Parser.locations("text/plain", locations_text, {})
|
195
|
-
expect(location).to eql expected
|
196
|
-
end
|
197
|
-
|
198
|
-
it 'copes with unmeaningful input' do
|
199
|
-
location = Occi::Parser.locations("nonexistent", "", {})
|
200
|
-
expect(location).to eql []
|
201
|
-
end
|
202
|
-
|
203
|
-
it 'parses "Location" hashes from header, solo' do
|
204
|
-
header = Hashie::Mash.new
|
205
|
-
header['Location'] = "http://example.com:8090/a/b/vm1"
|
206
|
-
location = Occi::Parser.locations("", "", header)
|
207
|
-
expect(location).to eql single_expected
|
208
|
-
end
|
209
|
-
|
210
|
-
it 'parses "Location" hashes from header in combination with X-OCCI-Location strings' do
|
211
|
-
header = Hashie::Mash.new
|
212
|
-
header['Location'] = "http://example.com:8090/a/b/vm1"
|
213
|
-
header['X-OCCI-Location'] = "http://example.com:8090/a/b/vm2"
|
214
|
-
locations_text = "X-OCCI-Location: http://example.com:8090/a/b/vm1\nX-OCCI-Location: http://example.com:8090/a/b/vm2"
|
215
|
-
location = Occi::Parser.locations("", "", header)
|
216
|
-
expect(location).to eql expected
|
217
|
-
end
|
218
|
-
end
|
219
|
-
|
220
|
-
context '.parse_body_plain' do
|
221
|
-
it 'parses categories' do
|
222
|
-
categories_string = File.open("spec/occi/parser/text_samples/occi_categories.text", "rt").read
|
223
|
-
categories = Occi::Parser.parse('text/plain', categories_string, true)
|
224
|
-
expected = File.open("spec/occi/parser/text_samples/occi_categories.body_plain.expected", "rt").read
|
225
|
-
expect(categories.to_text).to eql expected
|
226
|
-
end
|
227
|
-
|
228
|
-
it 'parses resources' do
|
229
|
-
resource_string = File.open("spec/occi/parser/text_samples/occi_network_rocci_server.text", "rt").read
|
230
|
-
resource = Occi::Parser.parse('text/plain', resource_string, false, Occi::Core::Resource)
|
231
|
-
expected = File.open("spec/occi/parser/text_samples/occi_network_rocci_server.body_plain.expected", "rt").read.chomp
|
232
|
-
expect(resource.to_text).to eql expected
|
233
|
-
end
|
234
|
-
|
235
|
-
it 'parses links' do
|
236
|
-
link_string = File.open("spec/occi/parser/text_samples/occi_link_resource_instance.text", "rt").read
|
237
|
-
link = Occi::Parser.parse('text/plain', link_string, false, Occi::Core::Link)
|
238
|
-
expected = File.open("spec/occi/parser/text_samples/occi_link_resource_instance.body_plain.expected", "rt").read.chomp
|
239
|
-
expect(link.to_text).to eql expected
|
240
|
-
end
|
241
|
-
|
242
|
-
it 'copes with unknown entity type' do
|
243
|
-
expect{Occi::Parser.parse('text/plain', 'Category: TERM;scheme="http://a.a/a#";class=kind', false, Occi::Core::Kind)}.to raise_exception(Occi::Errors::ParserTypeError)
|
244
|
-
# This test works but the exception is actually raised in parse_headers(). Execution never gets to this branch in parse_body_plain()
|
245
|
-
end
|
246
|
-
end
|
247
|
-
|
248
|
-
context 'output from other producers' do
|
249
|
-
it 'parses input from FogBow Cloud' do
|
250
|
-
category_string = File.open("spec/occi/parser/text_samples/occi_resource_custom_class_w_attributes.text", "rt").read
|
251
|
-
collection = Occi::Parser.parse('text/plain', category_string)
|
252
|
-
expected = File.open("spec/occi/parser/text_samples/occi_resource_custom_class_w_attributes.parse.expected", "rt").read.chomp
|
253
|
-
expect(collection.to_text).to eql expected
|
254
|
-
end
|
255
|
-
|
256
|
-
end
|
257
|
-
|
258
|
-
end
|
259
|
-
end
|
data/spec/occi-core_spec.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
describe Occi do
|
2
|
-
include Occi
|
3
|
-
|
4
|
-
context ".kinds" do
|
5
|
-
it 'initializes kinds' do
|
6
|
-
kind = kinds
|
7
|
-
expect(kind).to eql []
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
context ".mixins" do
|
12
|
-
it 'initializes mixins' do
|
13
|
-
mixin = mixins
|
14
|
-
expect(mixin).to eql []
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
context ".actions" do
|
19
|
-
it 'initializes actions' do
|
20
|
-
action = actions
|
21
|
-
expect(actions).to eql []
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
context ".categories" do
|
26
|
-
it 'returns lists of categories' do
|
27
|
-
cat = categories
|
28
|
-
expect(cat).to eql []
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
|
3
|
-
# enable coverage reports
|
4
|
-
if ENV['COVERAGE']
|
5
|
-
require 'simplecov'
|
6
|
-
|
7
|
-
SimpleCov.add_filter "/spec/"
|
8
|
-
SimpleCov.start
|
9
|
-
end
|
10
|
-
|
11
|
-
require 'occi-core'
|
12
|
-
require 'json_spec'
|
13
|
-
|
14
|
-
Dir["#{File.dirname(__FILE__)}/helpers/*.rb"].each {|file| require file }
|
15
|
-
|
16
|
-
RSpec.configure do |c|
|
17
|
-
c.include JsonSpec::Helpers
|
18
|
-
end
|