Sha256: be92cda70d0f04ad9d47e03388ff94119968c387b74c2972f90acaf79cfcdb1b
Contents?: true
Size: 1.23 KB
Versions: 61
Compression:
Stored size: 1.23 KB
Contents
Given /^NetSaint configuration is at "([^"]*)"$/ do |path| require 'pathname' root = Pathname.new(path) files = [] files << root.join('commands.cfg') files << root.join('netsaint.cfg') files << root.join('resource.cfg') File.directory?(root).should be_true files.each do |filename| File.exists?(filename).should be_true end end Then /^I should see a valid JSON output$/ do lambda { parser = Yajl::Parser.new @data = parser.parse(@output) }.should_not raise_error end Then /^show me the output$/ do puts @output end Then /^I should see a list of (\w+)$/ do |type| @data[type].should_not be_nil @data[type].size.should > 0 end Then /^I should see the following attributes for every (\w+):$/ do |type, table| type += 's' values = table.hashes.find_all {|h| !h.key?("nillable?") }.map {|h| h["attribute"] } @data[type].each_pair do |name, items| items.each do |item| values.each do |attr| item[attr].should_not be_nil end end end nils = table.hashes.find_all {|h| h.key?("nillable?") }.map {|h| h["attribute"] } @data[type].each_pair do |name, items| items.each do |item| nils.each do |attr| item.member?(attr).should be_true end end end end
Version data entries
61 entries across 61 versions & 1 rubygems