Sha256: a68f450d1ae37e33dc8202ff5587e22b669cac27f4e869e3d8b09d68fd6dc13e
Contents?: true
Size: 1.32 KB
Versions: 1
Compression:
Stored size: 1.32 KB
Contents
Feature: Check existence of directories Use the `#directory?` to check if a path is a directory and exists within `aruba`'s working directory. ```ruby require 'spec_helper' RSpec.configure do |config| config.include Aruba::Api end RSpec.describe 'Check if directory and file exist' do let(:directory) { 'dir.d' } before(:each) { create_directory(directory) } it { expect(directory?(directory)).to be true } end ``` Background: Given I use a fixture named "cli-app" Scenario: Is directory and exist Given a file named "spec/create_directory_spec.rb" with: """ require 'spec_helper' RSpec.describe 'Check if directory and file exist', :type => :aruba do let(:directory) { 'dir.d' } before(:each) { create_directory(directory) } it { expect(directory?(directory)).to be true } end """ When I run `rspec` Then the specs should all pass Scenario: Is file, but should be directory and exist Given a file named "spec/create_directory_spec.rb" with: """ require 'spec_helper' RSpec.describe 'Check if directory and file exist', :type => :aruba do let(:file) { 'file.txt' } before(:each) { touch(file) } it { expect(directory?(file)).to be false } end """ When I run `rspec` Then the specs should all pass
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
aruba-0.9.0.pre | features/api/filesystem/is_directory.feature |