File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def map_hash_arg(arg)
4343 "--#{ k } "
4444 end
4545
46- [ key , v . is_a? ( TrueClass ) ? nil : v ] . compact . join ( " " )
46+ [ key , v . is_a? ( TrueClass ) ? nil : "' #{ v } '" ] . compact . join ( " " )
4747 end . compact
4848 end
4949 end
Original file line number Diff line number Diff line change @@ -129,6 +129,16 @@ def subject_call
129129 end
130130 end
131131
132+ describe "Validating Command Class" do
133+ context "when hash arg value has is not a TrueClass" do
134+ let ( :subject_instance ) { RubyShell ::Command . new ( "example" , firstparam : "Short Phrase" ) }
135+
136+ it "returns the correct shell command" do
137+ expect ( subject_instance . to_shell ) . to eq ( "example --firstparam 'Short Phrase'" )
138+ end
139+ end
140+ end
141+
132142 it "has a version number" do
133143 expect ( RubyShell ::VERSION ) . not_to be nil
134144 end
You can’t perform that action at this time.
0 commit comments