Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #909 from calabash/feature/dot-dir
Calabash can manage a ~/.calabash directory
- Loading branch information
Showing
8 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# A module for managing the ~/.calabash directory. | ||
module Calabash::DotDir | ||
|
||
def self.directory | ||
home = RunLoop::Environment.user_home_directory | ||
dir = File.join(home, ".calabash") | ||
if !File.exist?(dir) | ||
FileUtils.mkdir_p(dir) | ||
end | ||
dir | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
describe Calabash::DotDir do | ||
|
||
let(:home_dir) { "./tmp/dot-calaash-examples" } | ||
let(:dot_dir) { File.join(home_dir, ".calabash") } | ||
|
||
before do | ||
allow(RunLoop::Environment).to receive(:user_home_directory).and_return home_dir | ||
FileUtils.rm_rf(home_dir) | ||
end | ||
|
||
it ".directory" do | ||
path = Calabash::DotDir.directory | ||
|
||
expect(File.exist?(path)).to be_truthy | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd calabash-cucumber | ||
rbenv local 2.2.3 | ||
gem uninstall -Vax --force --no-abort-on-dependent run_loop | ||
bundle update | ||
rm -rf spec/reports | ||
rbenv exec \ | ||
bundle exec \ | ||
rspec \ | ||
spec/lib | ||
|