Skip to content

Commit b4f7373

Browse files
committed
add specs to ensure config always composes
1 parent 04c9c16 commit b4f7373

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

spec/bashly/config_spec.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,17 @@
1818

1919
context "with a string argument" do
2020
let(:config) { "spec/fixtures/config.yml" }
21+
2122
it "treats the string as a path to YAML and loads it" do
22-
expect(subject["loaded"]).to eq "yes indeed"
23+
expect(subject["loaded"]).to eq "yes indeed"
24+
end
25+
26+
context "when the loaded YAML contains import directives" do
27+
let(:config) { "spec/fixtures/import.yml" }
28+
29+
it "evaluates them" do
30+
expect(subject["commands"].first['loaded']).to eq "yes indeed"
31+
end
2332
end
2433
end
2534

spec/fixtures/import.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
commands:
2+
- import: spec/fixtures/config.yml
3+

0 commit comments

Comments
 (0)