Sha256: a0e93d43aad805f1ded7319f140d2f6d98b05fa95983465271c560c88724c4b5

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

Given /^"([^\"]*)" feature is "([^\"]*)"$/ do |feature, state|
  enable_or_disable = (state == "enabled") ? :enable : :disable
  Middleman::Base.send(enable_or_disable, feature.to_sym)
  @browser = Rack::Test::Session.new(Rack::MockSession.new(Middleman::Base.new))
end

Given /^generated directory at "([^\"]*)"$/ do |dirname|
  target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "spec", "fixtures", dirname)
  init_cmd = File.expand_path(File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "bin", "mm-init"))
  `cd #{File.dirname(target)} && #{init_cmd} #{File.basename(target)}`
end

When /^I go to "([^\"]*)"$/ do |url|
  @browser.get(url)
end

Then /^I should see "([^\"]*)"$/ do |expected|
  @browser.last_response.body.should include(expected)
end

Then /^I should not see "([^\"]*)"$/ do |expected|
  @browser.last_response.body.should_not include(expected)
end

Then /^I should see "([^\"]*)" lines$/ do |lines|
  $stderr.puts @browser.last_response.body
  @browser.last_response.body.chomp.split($/).length.should == lines.to_i
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
middleman-0.99.0.pre features/step_definitions/middleman_steps.rb
middleman-0.9.0.pre features/step_definitions/middleman_steps.rb