Skip to content

Commit fcb29b3

Browse files
author
Edward Paulet
committed
Merge pull request #123 from rainforestapp/hotfix/new-test-name-path
fix bug with file name for new test being expanded
2 parents e5a5c97 + dc21920 commit fcb29b3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/rainforest/cli/options.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ def initialize(args)
121121

122122
if ['new', 'rm'].include?(@command)
123123
@file_name = @args.shift
124-
@file_name = File.expand_path(@file_name) if @file_name
124+
125+
if @file_name && @command == 'rm'
126+
@file_name = File.expand_path(@file_name) if @file_name
127+
end
125128
end
126129

127130
@tests = @args.dup

spec/options_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
its(:crowd) { should == 'some_name' }
2525
end
2626

27+
context 'new' do
28+
let(:args) { ['new', 'foo.rfml']}
29+
its(:command) { should == 'new' }
30+
its(:file_name) { should == 'foo.rfml' }
31+
end
32+
2733
context 'rm' do
2834
let(:args) { ['rm', 'foo.rfml']}
2935
its(:command) { should == 'rm' }

0 commit comments

Comments
 (0)