From: scribu Date: Tue, 30 Apr 2013 14:26:51 +0000 (+0300) Subject: behat: add newline to generated files X-Git-Tag: v0.10.0~84^2~2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=938d2ba47491ea86a965f125f224ba3536ee9ce9;p=wvm%2Fwvm.git behat: add newline to generated files `wp shell` expects it --- diff --git a/features/shell.feature b/features/shell.feature index 924f84fa..21317720 100644 --- a/features/shell.feature +++ b/features/shell.feature @@ -9,3 +9,23 @@ Feature: WordPress REPL """ Type "exit" to close session. """ + + Scenario: Basic session + Given a WP install + And a session file: + """ + WP_ADMIN + $_ + get_current_user_id() + $_ + """ + + When I run `wp shell --quiet < session` + Then it should run without errors + And STDOUT should be: + """ + true + true + 0 + 0 + """ diff --git a/features/steps/basic_steps.php b/features/steps/basic_steps.php index 1d10594d..0002a6c5 100644 --- a/features/steps/basic_steps.php +++ b/features/steps/basic_steps.php @@ -12,7 +12,8 @@ $steps->Given( '/^an empty directory$/', $steps->Given( '/^a ([^\s]+) file:$/', function ( $world, $path, PyStringNode $content ) { - file_put_contents( $world->get_path( $path ), (string) $content ); + $content = (string) $content . "\n"; + file_put_contents( $world->get_path( $path ), $content ); } );