Fork me on GitHub

Лупайте сю скалу...

Іван Франко


 RSS | Atom

19 June 2015

TOP »

Selected projects See all »

Banalize: Bash static code analyzerDBIx::Report::ExcelShell settings, AKA dotfilesNagios Monitoring for Couchbase serverNagira: RESTful API for NagiosStartpack for Github pages developmentWeb iPhoto

Travel Blog Витрішки »

Україномовний блог Витрішки - блог про все, крім роботи. Цикл статей "Літо на півночі Японії" з цього блогу тепер опублікований у Витрішках

Computer Blog All posts »

iPhoto and files permission Is MacOSX 10.9 == MacOS 9.x? Running Chef roles from Capistrano und Capiche Github & Jekyll: Speeding up Jekyll siteGithub & Jekyll: More experience with Jekyll and setup changesBuild new hosts with Capistrano and Chef Request Tracker: More about custom CSS for RT4Ruby 2 test drive Nagira v0.2.5 release It's UNIX my dear Watson

Slides See all »

Nagira @TLUG, 2012Rspec and Guard

About

Ярило Yarylo, Jarilo me @ github me @ CPAN Dmytro (CV)

RSpec tests for Normalized Hash
Table Of Contents

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





дмитро ковальов
dmytro @ github
dmytro.sytes.net