Skip to content

Commit

Permalink
Merge 30bcc33 into 6df10d1
Browse files Browse the repository at this point in the history
  • Loading branch information
rpassis committed Nov 9, 2016
2 parents 6df10d1 + 30bcc33 commit d2a40d4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## Unreleased

- Add ability for pre_window commands to parse yaml arrays

### Misc
- Removed support for Ruby 1.9.3
- Move gem dependencies from Gemfile to tmuxinator.gemspec
Expand Down
3 changes: 2 additions & 1 deletion lib/tmuxinator/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def pre_window
elsif pre_tab?
yaml["pre_tab"]
else
yaml["pre_window"]
pre_window = yaml["pre_window"]
pre_window.is_a?(Array) ? pre_window.join("; ") : pre_window
end
end

Expand Down
23 changes: 21 additions & 2 deletions spec/lib/tmuxinator/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,27 @@
end

describe "#pre_window" do
it "gets the pre_window command" do
expect(project.pre_window).to eq "rbenv shell 2.0.0-p247"
subject(:pre_window) { project.pre_window }

context "pre_window in yaml is string" do
before { project.yaml["pre_window"] = "mysql.server start" }

it "returns the string" do
expect(pre_window).to eq("mysql.server start")
end
end

context "pre_window in yaml is Array" do
before do
project.yaml["pre_window"] = [
"mysql.server start",
"memcached -d"
]
end

it "joins array using ;" do
expect(pre_window).to eq("mysql.server start; memcached -d")
end
end

context "with deprecations" do
Expand Down

0 comments on commit d2a40d4

Please sign in to comment.