Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Added spec tests for env vars with whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianofranz committed Aug 21, 2013
1 parent bfe6019 commit 4588853
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/rhc/commands/env_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def succeed_without_message(message="done")
['env', 'set', '_FOO=1', '--app', 'mock_app_0', '--noprompt', '--confirm'],
['env', 'set', 'FOO=BAR=BAZ', '--app', 'mock_app_0', '--noprompt', '--confirm'],
['env', 'set', 'FOO==', '--app', 'mock_app_0', '--noprompt', '--confirm'],
['env', 'set', 'FOO=Test 1 2 3', '--app', 'mock_app_0', '--noprompt', '--confirm'],
#['env', 'set', '--env', 'TEST_ENV_VAR="1"', '--app', 'mock_app_0', '--noprompt', '--confirm' ],
#['env', 'set', '--env', "TEST_ENV_VAR='1'", '--app', 'mock_app_0', '--noprompt', '--confirm' ]
].each_with_index do |args, i|
Expand Down
7 changes: 7 additions & 0 deletions spec/rhc/helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,15 @@ def options
it { subject.collect_env_vars('FOO==').first.to_hash.should == { :name => 'FOO', :value => '=' } }
it { subject.collect_env_vars('FOO=BAR=ZEE').first.to_hash.should == { :name => 'FOO', :value => 'BAR=ZEE' } }
it { subject.collect_env_vars('foo25_=BAR=\][#%*').first.to_hash.should == { :name => 'foo25_', :value => 'BAR=\][#%*' } }
it { subject.collect_env_vars('FOO=Test 1 2 3').first.to_hash.should == { :name => 'FOO', :value => 'Test 1 2 3' } }
it { subject.collect_env_vars('2FOO=BAR').empty?.should be_true }
it { subject.collect_env_vars('FOO.2=BAR').empty?.should be_true }
it { subject.collect_env_vars('FOO BAR=ZEE').empty?.should be_true }
it { subject.collect_env_vars('FOO*BAR=ZEE').empty?.should be_true }
it { subject.collect_env_vars('FOO&BAR=ZEE').empty?.should be_true }
it { subject.collect_env_vars('FOO:BAR=ZEE').empty?.should be_true }
it { subject.collect_env_vars('FOO@BAR=ZEE').empty?.should be_true }
it { subject.collect_env_vars('FOO!BAR=ZEE').empty?.should be_true }
end
end

Expand Down

0 comments on commit 4588853

Please sign in to comment.