Permalink
Browse files

Cuke the upgrade rake task

  • Loading branch information...
1 parent 0984dfe commit 17b10d86d0955be562e674a9395a01a14553592c @kennethkalmer committed Sep 16, 2013
Showing with 40 additions and 0 deletions.
  1. +8 −0 features/step_definitions/daemon_steps.rb
  2. +21 −0 features/support/fixtures.rb
  3. +11 −0 features/upgrades.feature
@@ -17,3 +17,11 @@
gemfile.should_not =~ /^gem 'daemon\-kit'$/
end
end
+
+Given(/^I have a daemon generated by daemon\-kit "(.*?)"$/) do |project|
+ copy_fixture_project( project )
+end
+
+Given(/^I cd to the old project$/) do
+ cd "fixture_project"
+end
@@ -0,0 +1,21 @@
+module ProjectFixtures
+ DAEMON_FIXTURES_PATH = File.expand_path( '../../../spec/fixtures', __FILE__ )
+
+ def copy_fixture_project( name )
+ name = case name
+ when '0.2.3'
+ 'zero_two_three'
+ else
+ raise ArgumentError, "Unknown fixture project: #{name}"
+ end
+
+ src = File.join( DAEMON_FIXTURES_PATH, name )
+
+ in_current_dir do
+ FileUtils.cp_r( src, 'fixture_project' )
+ end
+ end
+
+end
+
+World( ProjectFixtures )
@@ -0,0 +1,11 @@
+Feature: Upgrading an older daemon
+
+ daemon-kit offers help during upgrades to newer versions.
+
+ Scenario: Upgrading from 0.2.3
+ Given I have a daemon generated by daemon-kit "0.2.3"
+ And I cd to the old project
+ When I run `rake daemon_kit:upgrade` interactively
+ And I accept the conflicts
+ Then the file "Gemfile" should contain "gem 'daemon-kit', :github => 'kennethkalmer/daemon-kit'"
+ And the file "config/boot.rb" should not contain "VendorBoot"

0 comments on commit 17b10d8

Please sign in to comment.