Sha256: 3bd004b9654e120a94b1ab28d064ff282feaf17a4a6e76d998c7fe2441367719

Contents?: true

Size: 521 Bytes

Versions: 2

Compression:

Stored size: 521 Bytes

Contents

require 'erb'

Given /^I have ci jobs:$/ do |table|
  @jobs = table.hashes
end

Given /^a stdout ci handler$/ do
  @handlers = <<EOF
when_anything do |state|
  state.jobs each do |job|
    puts "#{job.name} is #{job.status}"
  end
end
EOF
end

When /^I engage in chicanery$/ do
  jobs, handlers = @jobs, @handlers
  template = ERB.new <<EOF
<% @jobs.each do |job| %>
  job "<%= job['name'] %>
<% end %>

<% @handlers %>
EOF
  write_file 'configuration', template.result(binding)
  run_simple 'chicanery configuration'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chicanery-0.0.3 features/step_definitions/ci_steps.rb
chicanery-0.0.2 features/step_definitions/ci_steps.rb