Sha256: b4174263a5c88090a903e8b07fe0ea6c7dd0e3ba6ca87a25abd15c9852775841
Contents?: true
Size: 1.16 KB
Versions: 1
Compression:
Stored size: 1.16 KB
Contents
Feature: Check if path is absolute Use the `#absolute?`-method to check if a path is an absolute path. ```ruby require 'spec_helper' RSpec.configure do |config| config.include Aruba::Api end RSpec.describe 'Check if directory or file is absolute' do let(:path) { '/path/to/file.txt' } it { expect(absolute?(path)).to be true } end ``` Background: Given I use a fixture named "cli-app" Scenario: Is path absolute Given a file named "spec/create_directory_spec.rb" with: """ require 'spec_helper' RSpec.describe 'Check if directory or file is absolute', :type => :aruba do let(:path) { '/path/to/file.txt' } it { expect(absolute?(path)).to be true } end """ When I run `rspec` Then the specs should all pass Scenario: Path should be absolute, but it's relative Given a file named "spec/create_directory_spec.rb" with: """ require 'spec_helper' RSpec.describe 'Check if directory or file is absolute', :type => :aruba do let(:path) { 'file.txt' } it { expect(absolute?(path)).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_absolute.feature |