diff --git a/.gitignore b/.gitignore index 8efccd2..3bcea05 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,7 @@ provision/* !provision/site-cookbooks package.box .idea/ +Gemfile +Gemfile.lock +Rakefile +spec diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 992ada6..0000000 --- a/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source "https://rubygems.org" - -gem "rake" -gem "serverspec" diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index bf6dace..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,32 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - diff-lcs (1.2.5) - highline (1.6.21) - net-ssh (2.9.1) - rake (10.3.2) - rspec (2.99.0) - rspec-core (~> 2.99.0) - rspec-expectations (~> 2.99.0) - rspec-mocks (~> 2.99.0) - rspec-core (2.99.2) - rspec-expectations (2.99.2) - diff-lcs (>= 1.1.3, < 2.0) - rspec-its (1.0.1) - rspec-core (>= 2.99.0.beta1) - rspec-expectations (>= 2.99.0.beta1) - rspec-mocks (2.99.2) - serverspec (1.16.0) - highline - net-ssh - rspec (~> 2.99) - rspec-its - specinfra (~> 1.27) - specinfra (1.27.2) - -PLATFORMS - ruby - -DEPENDENCIES - rake - serverspec diff --git a/Rakefile b/Rakefile deleted file mode 100644 index b6a9881..0000000 --- a/Rakefile +++ /dev/null @@ -1,8 +0,0 @@ -require 'rake' -require 'rspec/core/rake_task' - -RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = 'spec/*/*_spec.rb' -end - -task :default => :spec diff --git a/spec/default/vccw_spec.rb b/spec/default/vccw_spec.rb deleted file mode 100644 index a7d6562..0000000 --- a/spec/default/vccw_spec.rb +++ /dev/null @@ -1,71 +0,0 @@ -# encoding: utf-8 -# vim: ft=ruby expandtab shiftwidth=2 tabstop=2 - -require 'serverspec' -require 'pathname' -require 'net/ssh' -require 'spec_helper' - -include SpecInfra::Helper::Ssh -include SpecInfra::Helper::DetectOS - -describe file('/usr/local/share/wp-i18n/makepot.php') do - let(:disable_sudo) { true } - it { should be_file } -end - -describe command('grunt --version') do - let(:disable_sudo) { true } - it { should return_exit_status 0 } -end - -describe command('grunt-init --version') do - let(:disable_sudo) { true } - it { should return_exit_status 0 } -end - -describe file('/home/vagrant/.grunt-init/hatamoto/README.md') do - let(:disable_sudo) { true } - it { should be_file } -end - -describe file('/home/vagrant/.grunt-init/iemoto/README.md') do - let(:disable_sudo) { true } - it { should be_file } -end - -describe command('/usr/local/bin/phpunit --version') do - let(:disable_sudo) { true } - it { should return_exit_status 0 } -end - -describe file('/tmp/wordpress/license.txt') do - let(:disable_sudo) { true } - it { should be_file } -end - -describe command('/usr/local/bin/composer --version') do - let(:disable_sudo) { true } - it { should return_exit_status 0 } -end - -describe command('~/.composer/vendor/bin/phpcs --version') do - let(:disable_sudo) { true } - it { should return_exit_status 0 } -end - -describe file('/vagrant/Movefile') do - let(:disable_sudo) { true } - it { should be_file } -end - -describe command('wordmove help') do - let(:disable_sudo) { true } - it { should return_exit_status 0 } -end - -# describe command('wpcs --version') do -# let(:disable_sudo) { true } -# let(:pre_command) { 'source ~/.bash_profile' } -# it { should return_exit_status 0 } -# end diff --git a/spec/default/wp-cli_spec.rb b/spec/default/wp-cli_spec.rb deleted file mode 100644 index e70b112..0000000 --- a/spec/default/wp-cli_spec.rb +++ /dev/null @@ -1,91 +0,0 @@ -# encoding: utf-8 -# vim: ft=ruby expandtab shiftwidth=2 tabstop=2 - -require 'serverspec' -require 'pathname' -require 'net/ssh' -require 'spec_helper' - -include SpecInfra::Helper::Ssh -include SpecInfra::Helper::DetectOS - -describe package('httpd') do - it { should be_installed } -end - -describe service('httpd') do - it { should be_enabled } -end - -describe service('httpd') do - it { should be_running } -end - -describe port(80) do - it { should be_listening } -end - -describe 'PHP config parameters' do - context php_config('default_charset') do - its(:value) { should eq 'UTF-8' } - end - - context php_config('mbstring.language') do - its(:value) { should eq 'neutral' } - end - - context php_config('mbstring.internal_encoding') do - its(:value) { should eq 'UTF-8' } - end - - context php_config('date.timezone') do - its(:value) { should eq 'UTC' } - end - - context php_config('short_open_tag') do - its(:value) { should eq 'Off' } - end - - context php_config('session.save_path') do - its(:value) { should eq '/tmp' } - end - -end - -describe command('wp --version') do - let(:disable_sudo) { true } - it { should return_exit_status 0 } -end - -describe command('wp help dictator') do - let(:disable_sudo) { true } - it { should return_exit_status 0 } -end - -describe command("wget -q http://localhost/ -O - | head -100 | grep generator") do - it { should return_stdout //)[1] - else - file = block.source_location.first - end - host = File.basename(Pathname.new(file).dirname) - if c.host != host - c.ssh.close if c.ssh - c.host = host - options = Net::SSH::Config.for(c.host) - user = options[:user] || Etc.getlogin - # vagrant_up = `VAGRANT_VAGRANTFILE=Vagrantfile.sample vagrant up default` - config = `VAGRANT_VAGRANTFILE=Vagrantfile.sample vagrant ssh-config default` - if config != '' - config.each_line do |line| - if match = /HostName (.*)/.match(line) - host = match[1] - elsif match = /User (.*)/.match(line) - user = match[1] - elsif match = /IdentityFile (.*)/.match(line) - options[:keys] = [match[1].gsub(/"/,'')] - elsif match = /Port (.*)/.match(line) - options[:port] = match[1] - end - end - end - c.ssh = Net::SSH.start(host, user, options) - end - end -end