Skip to content

Commit 7e916b4

Browse files
committed
Adding a scenario for transfering a file from a specific cookbook
1 parent 409ffd2 commit 7e916b4

4 files changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#
2+
# Cookbook Name:: transfer_remote_files
3+
# Recipe:: default
4+
#
5+
# Copyright 2009, Opscode
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
transfer_cookbook "from_definition.txt"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
define :transfer_cookbook do
2+
remote_file "#{node[:tmpdir]}/#{params[:name]}" do
3+
source "easy.txt"
4+
cookbook "transfer_remote_files_definition"
5+
end
6+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
easy like saturday morning

features/transfer_remote_files.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,10 @@ Feature: Transfer Remote Files
3939
When I run the chef-client
4040
Then the run should exit '0'
4141
And a file named 'host_specific.txt' should be from the 'platform' specific directory
42+
43+
Scenario: Transfer a file from a specific cookbook
44+
Given a validated node
45+
And it includes the recipe 'transfer_remote_files::transfer_a_file_from_a_specific_cookbook'
46+
When I run the chef-client
47+
Then the run should exit '0'
48+
And a file named 'from_definition.txt' should contain 'easy like saturday morning'

0 commit comments

Comments
 (0)