diff --git a/spec/lib/rex/exploitation/cmdstager/base_spec.rb b/spec/lib/rex/exploitation/cmdstager/base_spec.rb index c3bb4a5e98..7667ce19b9 100644 --- a/spec/lib/rex/exploitation/cmdstager/base_spec.rb +++ b/spec/lib/rex/exploitation/cmdstager/base_spec.rb @@ -8,8 +8,7 @@ describe Rex::Exploitation::CmdStagerBase do let(:exe) { "MZ" } subject(:cmd_stager) do - cmd_stager = Rex::Exploitation::CmdStagerBase.new(exe) - cmd_stager + described_class.new(exe) end describe '#cmd_concat_operator' do diff --git a/spec/lib/rex/exploitation/cmdstager/bourne_spec.rb b/spec/lib/rex/exploitation/cmdstager/bourne_spec.rb index 075a7adf45..0a072db8a9 100644 --- a/spec/lib/rex/exploitation/cmdstager/bourne_spec.rb +++ b/spec/lib/rex/exploitation/cmdstager/bourne_spec.rb @@ -8,8 +8,7 @@ describe Rex::Exploitation::CmdStagerBourne do let(:exe) { "MZ" } subject(:cmd_stager) do - cmd_stager = Rex::Exploitation::CmdStagerBourne.new(exe) - cmd_stager + described_class.new(exe) end describe '#cmd_concat_operator' do @@ -20,7 +19,10 @@ describe Rex::Exploitation::CmdStagerBourne do describe '#generate' do it "returns an array of commands" do - expect(cmd_stager.generate).to_not be_empty + result = cmd_stager.generate + + expect(result).to be_kind_of(Array) + expect(result).to_not be_empty end end diff --git a/spec/lib/rex/exploitation/cmdstager/debug_asm_spec.rb b/spec/lib/rex/exploitation/cmdstager/debug_asm_spec.rb index c981a8ef04..06d53c477e 100644 --- a/spec/lib/rex/exploitation/cmdstager/debug_asm_spec.rb +++ b/spec/lib/rex/exploitation/cmdstager/debug_asm_spec.rb @@ -8,8 +8,7 @@ describe Rex::Exploitation::CmdStagerDebugAsm do let(:exe) { "MZ" } subject(:cmd_stager) do - cmd_stager = Rex::Exploitation::CmdStagerDebugAsm.new(exe) - cmd_stager + described_class.new(exe) end describe '#cmd_concat_operator' do @@ -26,7 +25,10 @@ describe Rex::Exploitation::CmdStagerDebugAsm do end it "returns an array of commands" do - expect(cmd_stager.generate(opts)).to_not be_empty + result = cmd_stager.generate(opts) + + expect(result).to be_kind_of(Array) + expect(result).to_not be_empty end end diff --git a/spec/lib/rex/exploitation/cmdstager/debug_write_spec.rb b/spec/lib/rex/exploitation/cmdstager/debug_write_spec.rb index 6064f1d833..b70e228ada 100644 --- a/spec/lib/rex/exploitation/cmdstager/debug_write_spec.rb +++ b/spec/lib/rex/exploitation/cmdstager/debug_write_spec.rb @@ -8,8 +8,7 @@ describe Rex::Exploitation::CmdStagerDebugWrite do let(:exe) { "MZ" } subject(:cmd_stager) do - cmd_stager = Rex::Exploitation::CmdStagerDebugWrite.new(exe) - cmd_stager + described_class.new(exe) end describe '#cmd_concat_operator' do @@ -26,7 +25,10 @@ describe Rex::Exploitation::CmdStagerDebugWrite do end it "returns an array of commands" do - expect(cmd_stager.generate(opts)).to_not be_empty + result = cmd_stager.generate(opts) + + expect(result).to be_kind_of(Array) + expect(result).to_not be_empty end end diff --git a/spec/lib/rex/exploitation/cmdstager/echo_spec.rb b/spec/lib/rex/exploitation/cmdstager/echo_spec.rb index b5091e14a3..a3d91f2382 100644 --- a/spec/lib/rex/exploitation/cmdstager/echo_spec.rb +++ b/spec/lib/rex/exploitation/cmdstager/echo_spec.rb @@ -8,8 +8,7 @@ describe Rex::Exploitation::CmdStagerEcho do let(:exe) { "MZ" } subject(:cmd_stager) do - cmd_stager = Rex::Exploitation::CmdStagerEcho.new(exe) - cmd_stager + described_class.new(exe) end describe '#cmd_concat_operator' do @@ -20,7 +19,10 @@ describe Rex::Exploitation::CmdStagerEcho do describe '#generate' do it "returns an array of commands" do - expect(cmd_stager.generate).to_not be_empty + result = cmd_stager.generate + + expect(result).to be_kind_of(Array) + expect(result).to_not be_empty end end diff --git a/spec/lib/rex/exploitation/cmdstager/printf_spec.rb b/spec/lib/rex/exploitation/cmdstager/printf_spec.rb index 7db94c4468..02927f7ecb 100644 --- a/spec/lib/rex/exploitation/cmdstager/printf_spec.rb +++ b/spec/lib/rex/exploitation/cmdstager/printf_spec.rb @@ -8,8 +8,7 @@ describe Rex::Exploitation::CmdStagerPrintf do let(:exe) { "MZ" } subject(:cmd_stager) do - cmd_stager = Rex::Exploitation::CmdStagerPrintf.new(exe) - cmd_stager + described_class.new(exe) end describe '#cmd_concat_operator' do @@ -20,7 +19,10 @@ describe Rex::Exploitation::CmdStagerPrintf do describe '#generate' do it "returns an array of commands" do - expect(cmd_stager.generate).to_not be_empty + result = cmd_stager.generate + + expect(result).to be_kind_of(Array) + expect(result).to_not be_empty end end diff --git a/spec/lib/rex/exploitation/cmdstager/tftp_spec.rb b/spec/lib/rex/exploitation/cmdstager/tftp_spec.rb index 7dc0567ba0..813533fd4d 100644 --- a/spec/lib/rex/exploitation/cmdstager/tftp_spec.rb +++ b/spec/lib/rex/exploitation/cmdstager/tftp_spec.rb @@ -8,8 +8,7 @@ describe Rex::Exploitation::CmdStagerTFTP do let(:exe) { "MZ" } subject(:cmd_stager) do - cmd_stager = Rex::Exploitation::CmdStagerTFTP.new(exe) - cmd_stager + described_class.new(exe) end describe '#cmd_concat_operator' do @@ -20,7 +19,10 @@ describe Rex::Exploitation::CmdStagerTFTP do describe '#generate' do it "returns an array of commands" do - expect(cmd_stager.generate).to_not be_empty + result = cmd_stager.generate + + expect(result).to be_kind_of(Array) + expect(result).to_not be_empty end end diff --git a/spec/lib/rex/exploitation/cmdstager/vbs_spec.rb b/spec/lib/rex/exploitation/cmdstager/vbs_spec.rb index aef762c5d3..9b30c4cceb 100644 --- a/spec/lib/rex/exploitation/cmdstager/vbs_spec.rb +++ b/spec/lib/rex/exploitation/cmdstager/vbs_spec.rb @@ -8,8 +8,7 @@ describe Rex::Exploitation::CmdStagerVBS do let(:exe) { "MZ" } subject(:cmd_stager) do - cmd_stager = Rex::Exploitation::CmdStagerVBS.new(exe) - cmd_stager + described_class.new(exe) end describe '#cmd_concat_operator' do @@ -26,7 +25,10 @@ describe Rex::Exploitation::CmdStagerVBS do end it "returns an array of commands" do - expect(cmd_stager.generate(opts)).to_not be_empty + result = cmd_stager.generate(opts) + + expect(result).to be_kind_of(Array) + expect(result).to_not be_empty end end