File tree 6 files changed +64
-12
lines changed
6 files changed +64
-12
lines changed Original file line number Diff line number Diff line change
1
+ language : ruby
2
+ rvm :
3
+ - 1.9.3
4
+ - 2.0.0
5
+ before_script :
6
+ - bundle exec berks install
7
+ - bundle exec foodcritic -f any .
Original file line number Diff line number Diff line change 1
1
source 'https://rubygems.org'
2
2
3
- gem 'rake'
4
- gem 'rspec'
5
3
gem 'foodcritic'
6
- gem 'berkshelf'
7
- gem 'thor-foodcritic'
8
- gem 'vagrant-wrapper'
9
-
10
- group :integration do
11
- gem 'test-kitchen' , :git => "git://github.com/opscode/test-kitchen.git"
12
- gem 'kitchen-vagrant' , :git => "git://github.com/opscode/kitchen-vagrant.git"
13
- gem 'kitchen-ec2' , :git => "git://github.com/opscode/kitchen-ec2.git"
14
- gem 'kitchen-lxc' , :git => "https://github.com/portertech/kitchen-lxc.git" , :tag => 'v0.0.1.beta2'
15
- end
4
+ gem 'berkshelf' , '~> 2.0'
5
+ gem 'chefspec' , '~> 3.0'
Original file line number Diff line number Diff line change
1
+ require 'rspec/core/rake_task'
2
+
3
+ RSpec ::Core ::RakeTask . new ( :spec )
4
+
5
+ task :default => :spec
Original file line number Diff line number Diff line change
1
+ if defined? ( ChefSpec )
2
+ def install_python_pip ( package_name )
3
+ ChefSpec ::Matchers ::ResourceMatcher . new ( :python_pip , :install , package_name )
4
+ end
5
+
6
+ def upgrade_python_pip ( package_name )
7
+ ChefSpec ::Matchers ::ResourceMatcher . new ( :python_pip , :upgrade , package_name )
8
+ end
9
+
10
+ def remove_python_pip ( package_name )
11
+ ChefSpec ::Matchers ::ResourceMatcher . new ( :python_pip , :remove , package_name )
12
+ end
13
+
14
+ def purge_python_pip ( package_name )
15
+ ChefSpec ::Matchers ::ResourceMatcher . new ( :python_pip , :purge , package_name )
16
+ end
17
+
18
+ def create_python_virtualenv ( virtualenv_name )
19
+ ChefSpec ::Matchers ::ResourceMatcher . new ( :python_virtualenv , :create , virtualenv_name )
20
+ end
21
+
22
+ def delete_python_virtualenv ( virtualenv_name )
23
+ ChefSpec ::Matchers ::ResourceMatcher . new ( :python_virtualenv , :delete , virtualenv_name )
24
+ end
25
+ end
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ describe 'python::default' do
4
+ let :chef_run do
5
+ ChefSpec ::Runner . new ( platform : 'ubuntu' , version : '12.04' ) . converge described_recipe
6
+ end
7
+
8
+ before do
9
+ stub_command ( "/usr/bin/python -c 'import setuptools'" ) . and_return ( true )
10
+ end
11
+
12
+ it 'includes python::package by default' do
13
+ expect ( chef_run ) . to include_recipe ( 'python::package' )
14
+ end
15
+
16
+ it 'includes python::pip' do
17
+ expect ( chef_run ) . to include_recipe ( 'python::pip' )
18
+ end
19
+
20
+ it 'includes python::virtualenv' do
21
+ expect ( chef_run ) . to include_recipe ( 'python::virtualenv' )
22
+ end
23
+ end
Original file line number Diff line number Diff line change
1
+ require 'chefspec'
2
+ require 'chefspec/berkshelf'
You can’t perform that action at this time.
0 commit comments