require 'spec_helper' describe Directory do it "has a path and a base dir" do Directory.new('path', 'basedir') end it "can be created" do dir = Directory.new('path', working_directory) dir.create dir_path = File.join(working_directory, 'path') result = File.exists?(dir_path) expect(result).to eq(true) end it "returns the full path" do dir = Directory.new('path', working_directory) check = File.join(working_directory, 'path') expect(dir.full_path).to eq(check) end it "returns path if it starts with '/'" do path = '/path' dir = Directory.new(path) expect(dir.full_path).to eq(path) end end