Sha256: a64ca998920ec1b240ee666829fa64d51041162f2006215392a1ffa7bc646fff

Contents?: true

Size: 1.19 KB

Versions: 15

Compression:

Stored size: 1.19 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 {
    @data = Oj.load(@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

15 entries across 15 versions & 1 rubygems

Version Path
flapjack-0.7.35 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.34 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.33 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.32 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.31 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.30 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.29 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.28 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.27 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.26 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.25 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.22 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.21 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.20 features/steps/flapjack-netsaint-parser_steps.rb
flapjack-0.7.19 features/steps/flapjack-netsaint-parser_steps.rb