summaryrefslogtreecommitdiff
path: root/spec/integration
diff options
context:
space:
mode:
authorGrégoire Seux <g.seux@criteo.com>2017-03-01 17:17:45 +0100
committerGrégoire Seux <g.seux@criteo.com>2017-03-06 12:00:35 +0100
commit215c81dcfee22147a447e4f6846c975215d11679 (patch)
tree0bf3e8e1cd189f0e2e81e384f033a8f40a887755 /spec/integration
parent39f3986e6804fe4c4bcbf08f69e3261c55f23b14 (diff)
downloadchef-215c81dcfee22147a447e4f6846c975215d11679.tar.gz
Support ruby role in knife serve
Change-Id: I1076b918e9153f21b4c49d77054899111106eb74 Signed-off-by: Grégoire Seux <g.seux@criteo.com>
Diffstat (limited to 'spec/integration')
-rw-r--r--spec/integration/knife/serve_spec.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/spec/integration/knife/serve_spec.rb b/spec/integration/knife/serve_spec.rb
index 04fc0563b6..f03b5b99e8 100644
--- a/spec/integration/knife/serve_spec.rb
+++ b/spec/integration/knife/serve_spec.rb
@@ -55,7 +55,8 @@ describe "knife serve", :workstation do
when_the_repository "also has one of each thing" do
before do
file "nodes/x.json", { "foo" => "bar" }
- file "roles/a_role_with_a_name.json", { "foo" => "bar" }
+ file "roles/a_role_in_json.json", { "foo" => "bar" }
+ file "roles/a_role_in_ruby.rb", "name 'a_role_in_ruby'"
end
it "knife serve serves up /nodes/x" do
@@ -63,9 +64,19 @@ describe "knife serve", :workstation do
expect(api.get("nodes/x")["name"]).to eq("x")
end
end
- it "knife serve serves up /roles" do
- with_knife_serve do |api|
- expect(api.get("roles")).to have_key("a_role_with_a_name")
+
+ %w(a_role_in_json a_role_in_ruby).each do |file_type|
+ context file_type do
+ it "knife serve serves up /roles" do
+ with_knife_serve do |api|
+ expect(api.get("roles")).to have_key(file_type)
+ end
+ end
+ it "knife serve serves up /roles/#{file_type}" do
+ with_knife_serve do |api|
+ expect(api.get("roles/#{file_type}")['name']).to eq(file_type)
+ end
+ end
end
end
end