blob: 227fd84db961045034deb21ddea23796d8779620 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# Run with:
# rspec -Ilib examples/foobar_spec.rb
require 'rspec'
require 'test_construct/rspec_integration'
describe "Foobar", test_construct: true do
it "creates file" do
example.metadata[:construct].directory "alice/rabbithole" do |d|
d.file "white_rabbit.txt", "I'm late!"
File.read("white_rabbit.txt").should == "I'm late!"
end
end
it "leaves file on error" do
example.metadata[:construct].directory "alice/rabbithole" do |d|
d.file "white_rabbit.txt", "I'm late!"
raise "Whoops"
end
end
end
describe "Foobar", test_construct: { keep_on_error: false} do
it "doesn't leave file on error" do
example.metadata[:construct].directory "alice/rabbithole" do |d|
d.file "white_rabbit.txt", "I'm late!"
raise "Whoops"
end
end
end
|