Skip to content

Commit

Permalink
Fixing specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
polarblau committed Mar 21, 2013
1 parent 961f646 commit 27e4495
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 24 deletions.
6 changes: 4 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ RSpec::Core::RakeTask.new(:rspec) do |spec|
end

task :simpletest do
puts "Running php unit tests ..."
if system("which php > /dev/null")
system "php test/all_tests.php"
else
Expand All @@ -17,8 +16,11 @@ task :simpletest do
end

task :test_all do
Rake::Task["rspec"].invoke
puts "Running php unit tests ..."
Rake::Task["simpletest"].invoke

puts "Running rspec specs ..."
Rake::Task["rspec"].invoke
end

task :default => :test_all
10 changes: 3 additions & 7 deletions lib/meta_wordpress.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#$:.unshift(File.expand_path(File.dirname(__FILE__)))
require 'haml'

if File.exists? 'Gemfile'
require 'haml'

require File.expand_path('haml/helpers', File.dirname(__FILE__))
require File.expand_path('haml/filters', File.dirname(__FILE__))
end
require File.expand_path('haml/helpers', File.dirname(__FILE__))
require File.expand_path('haml/filters', File.dirname(__FILE__))
2 changes: 1 addition & 1 deletion lib/meta_wordpress/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def bootstrap(theme_folder = nil)
inside(theme_folder || '.') do
copy_guard_file
create_asset_folders
create_views_folders
create_views_folder
create_view_helpers
copy_functions_php
copy_php_lib
Expand Down
4 changes: 2 additions & 2 deletions lib/meta_wordpress/cli/bootstrap_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def create_asset_folders
end
end

def create_views_folders
empty_directory source_path('views'), :verbose => false
def create_views_folder
empty_directory 'views', :verbose => false
end

def create_view_helpers
Expand Down
3 changes: 2 additions & 1 deletion spec/lib/meta_wordpress/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
end

describe "#create_views_folder" do
before { bootstrap.create_views_folders }
before { bootstrap.create_views_folder }
subject { "views" }

it { should have_been_created_in(project_path) }
Expand Down Expand Up @@ -80,6 +80,7 @@

describe "#ask_for_theme_details" do
it "should ask for details" do
bootstrap.instance_variable_set("@theme_folder", 'Foo')
details = %w(Theme\ name Theme\ url Author(s) Author(s)\ URL Description Version License License\ URL Tags Text\ domain)
# http://www.arailsdemo.com/posts/57
$stdin.should_receive(:gets).and_return(*details)
Expand Down
8 changes: 3 additions & 5 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
require 'rubygems'
require 'bundler'
require 'tmpdir'
require File.dirname(__FILE__) + '/support/file_matchers'
require File.join(File.dirname(__FILE__), 'support', 'file_matchers')

Bundler.setup

require 'rspec'

$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'meta_wordpress'
require File.join(File.dirname(__FILE__), '..', 'lib', 'meta_wordpress')

FIXTURES_DIR = Pathname.new(__FILE__).dirname + 'fixtures'

Expand All @@ -17,7 +15,7 @@

# https://github.com/docwhat/homedir/blob/homedir3/spec/spec_helper.rb#L14
config.before(:each) do
$0 = "wp"
$0 = "meta_wordpress"
ARGV.clear
@directory = Dir.mktmpdir('tmp-spec-')
@orig_directory = Dir.pwd
Expand Down
6 changes: 0 additions & 6 deletions test/unit/layout_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ function testStatePersists() {
}
}


class TestOfLayout extends UnitTestCase {

function __construct() {
parent::__construct('Layout class tests');
}
Expand All @@ -34,10 +32,6 @@ function testSetLayout() {
$this->assertEqual($this->layout->layout, 'foo');
}

function testSetLayoutAgain() {
$this->assertNotEqual($this->layout->layout, 'foo');
}

function testGetLayout() {}
}

Expand Down

0 comments on commit 27e4495

Please sign in to comment.