forked from cucumber/aruba
-
Notifications
You must be signed in to change notification settings - Fork 2
/
create_directory.feature
57 lines (42 loc) · 1.37 KB
/
create_directory.feature
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Feature: Create Directory
Use the `#create_directory`-method to create a directory within `aruba`'s
working directory.
```ruby
require 'spec_helper'
RSpec.configure do |config|
config.include Aruba::Api
end
RSpec.describe 'Create directory' do
let(:directory) { 'dir.d' }
before(:each) { create_directory(directory) }
it { expect(directory).to be_an_existing_directory }
end
```
Background:
Given I use a fixture named "cli-app"
Scenario: New directory
Given a file named "spec/create_directory_spec.rb" with:
"""ruby
require 'spec_helper'
RSpec.describe 'Create directory', :type => :aruba do
let(:directory) { 'dir.d' }
before(:each) { create_directory(directory) }
it { expect(directory).to be_an_existing_directory }
end
"""
When I run `rspec`
Then the specs should all pass
Scenario: Existing directory
It does not complain if a directory already exists.
Given a file named "spec/create_directory_spec.rb" with:
"""ruby
require 'spec_helper'
RSpec.describe 'Create directory', :type => :aruba do
let(:directory) { 'dir.d' }
before(:each) { create_directory(directory) }
before(:each) { create_directory(directory) }
it { expect(directory).to be_an_existing_directory }
end
"""
When I run `rspec`
Then the specs should all pass