RSpec tests for Normalized Hash
Specification to make data produced by data parser of server inventory scanner easy to use by software that does not know about internal data structure, i.e. data driven and schema-less. Data structures should be built in such a way as to make data self-documenting, easy adaptable and “software-friendly”.
These are RSpec tests for Normalized Hash data structure standard. Standard itself and rationale why we (I) need it, is described in NormalizedHash.md file.
RSpec deep hash tests were inspired by <https://github.com/vitalish/rspec-deep-matchers specs>
Usage
Installation
Rspec NormalizedHash test released as gem, install it as:
gem install rspec_normalized_hash
Example
require 'rspec_normalized_hash' describe "Good data structure" do before(:each) { subject @data } it { should have_keys_in_class [String, Symbol] } it { should have_values_in_class [Fixnum, String, Numeric, Hash, Array] } it { should have_array_values_in_class [String,Numeric,Hash] } it { should have_array_values_of_the_same_class } it { NOT IMPLEMENTED: enclosed arrays in Hash } end
Author
Dmytro Kovalov (dmytro.kovalov@gmail.com)
Source code
- Download rspec_normalized_hash in either zip or tar formats ⇒
- Clone rspec_normalized_hash with git
$ git clone git://github.com/dmytro/rspec_normalized_hash
- or go to rspec_normalized_hash's Github repository »