Sha256: 060d933889d66f62ac828bb3d26f8d6708a48fdd103da9f4de74fd7b6e4c5c7d
Contents?: true
Size: 1.16 KB
Versions: 31
Compression:
Stored size: 1.16 KB
Contents
Feature: Check if path is relative Use the `#relative?`-method to check if a path is an relative path. ```ruby require 'spec_helper' RSpec.configure do |config| config.include Aruba::Api end RSpec.describe 'Check if directory or file is relative' do let(:path) { '/path/to/file.txt' } it { expect(relative?(path)).to be true } end ``` Background: Given I use a fixture named "cli-app" Scenario: Is path relative Given a file named "spec/create_directory_spec.rb" with: """ruby require 'spec_helper' RSpec.describe 'Check if directory or file is relative', :type => :aruba do let(:path) { 'file.txt' } it { expect(relative?(path)).to be true } end """ When I run `rspec` Then the specs should all pass Scenario: Path should be relative, but it's relative Given a file named "spec/create_directory_spec.rb" with: """ruby require 'spec_helper' RSpec.describe 'Check if directory or file is relative', :type => :aruba do let(:path) { '/path/to/file.txt' } it { expect(relative?(path)).to be false } end """ When I run `rspec` Then the specs should all pass
Version data entries
31 entries across 31 versions & 2 rubygems