spec/common_spec.rb in linux_admin-0.20.0 vs spec/common_spec.rb in linux_admin-0.20.1

- old
+ new

@@ -17,19 +17,21 @@ it "returns false when the command doesn't exist" do expect(described_class.cmd?(:kasgbdlcvjhals)).to be false end end - describe "#run" do - it "runs a command with AwesomeSpawn.run" do - expect(AwesomeSpawn).to receive(:run).with("echo", nil => "test") - described_class.run("echo", nil => "test") + [described_class, LinuxAdmin].each do |klass| + describe "#{klass}.run" do + it "runs a command with AwesomeSpawn.run" do + expect(AwesomeSpawn).to receive(:run).with("echo", nil => "test") + klass.run("echo", nil => "test") + end end - end - describe "#run!" do - it "runs a command with AwesomeSpawn.run!" do - expect(AwesomeSpawn).to receive(:run!).with("echo", nil => "test") - described_class.run!("echo", nil => "test") + describe "#{klass}.run!" do + it "runs a command with AwesomeSpawn.run!" do + expect(AwesomeSpawn).to receive(:run!).with("echo", nil => "test") + klass.run!("echo", nil => "test") + end end end end