diff --git a/Gemfile b/Gemfile index c7043f4..b4fb54c 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,12 @@ source "https://rubygems.org" gemspec +group :test do + gem 'bundler' + gem 'rake' + gem 'rspec', '>= 3.2' +end + group :chefstyle do - gem "chefstyle", "2.2.3" + gem 'chefstyle', '>= 2.2.3' end diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..f1c0104 --- /dev/null +++ b/Rakefile @@ -0,0 +1,16 @@ +require "bundler/gem_tasks" +require "rspec/core/rake_task" + +begin + require "chefstyle" + require "rubocop/rake_task" + RuboCop::RakeTask.new(:style) do |task| + task.options += ["--display-cop-names", "--no-color"] + end +rescue LoadError + puts "chefstyle is not available. (sudo) gem install chefstyle to do style checking." +end + +RSpec::Core::RakeTask.new(:test) + +task default: %i{test style} diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..30e9e58 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,17 @@ +# +# Author:: Chef Partner Engineering () +# Copyright:: Copyright (c) 2015 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/spec/version_spec.rb b/spec/version_spec.rb new file mode 100644 index 0000000..154e156 --- /dev/null +++ b/spec/version_spec.rb @@ -0,0 +1,29 @@ +# Encoding: UTF-8 + +# +# Authors:: Chef Partner Engineering () +# Copyright:: Copyright (c) 2015 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require 'spec_helper' +require 'kitchen/driver/version' + +describe Kitchen::Driver::WORKFLOW_TESTING_VERSION do + let(:expected_version) { '1.0.0' } # replace with your expected version + + it 'has the correct version' do + expect(Kitchen::Driver::WORKFLOW_TESTING_VERSION::STRING).to eq(expected_version) + end +end