Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require File.dirname(__FILE__) + "/spec_helper"
- WP_DIR = "/Users/#{ENV['USER']}/Projects/wp/wordpress"
- PHP_INCLUDES ="
- include 'post.php';
- include '#{WP_DIR}/wp-includes/plugin.php';
- include '#{WP_DIR}/wp-content/themes/twentyten/functions.php';
- "
- describe "php haxxored through rspec" do
- def run_php(php)
- `php -r '#{PHP_INCLUDES} #{php}'`
- end
- it "should invoke php and return output" do
- run_php("echo 'hay!';").should == "hay!"
- end
- it "should invoke function defined in includes" do
- run_php("echo testing();").should == "TEST OUTPUT"
- end
- end
Add Comment
Please, Sign In to add comment