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

Version Path
flapjack-0.7.18 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.17 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.16 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.15 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.14 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.13 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.12 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.11 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.10 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.9 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.8 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.7 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.6 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.5 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.4 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.3 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.2 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.1 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.0 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.6.61 features/steps/flapjack-netsaint-parser_steps.rb