Sha256: 49ef0200624ad2d8982a0d0fc24ca1fc7aeadee52a31bb9daa7ce0b042047677

Contents?: true

Size: 806 Bytes

Versions: 3

Compression:

Stored size: 806 Bytes

Contents

# 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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
test_construct-2.0.2 examples/foobar_spec.rb
test_construct-2.0.1 examples/foobar_spec.rb
test_construct-2.0.0 examples/foobar_spec.rb