spec/common_spec.rb in linux_admin-0.14.0 vs spec/common_spec.rb in linux_admin-0.15.0
- old
+ new
@@ -1,37 +1,35 @@
describe LinuxAdmin::Common do
- subject { Class.new { include LinuxAdmin::Common }.new }
-
describe "#cmd" do
it "looks up local command from id" do
- expect(subject.cmd(:dd)).to match(/bin\/dd/)
+ expect(described_class.cmd(:dd)).to match(%r{bin/dd})
end
it "returns nil when it can't find the command" do
- expect(subject.cmd(:kasgbdlcvjhals)).to be_nil
+ expect(described_class.cmd(:kasgbdlcvjhals)).to be_nil
end
end
describe "#cmd?" do
it "returns true when the command exists" do
- expect(subject.cmd?(:dd)).to be true
+ expect(described_class.cmd?(:dd)).to be true
end
it "returns false when the command doesn't exist" do
- expect(subject.cmd?(:kasgbdlcvjhals)).to be false
+ 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")
- subject.run("echo", nil => "test")
+ described_class.run("echo", nil => "test")
end
end
describe "#run!" do
it "runs a command with AwesomeSpawn.run!" do
expect(AwesomeSpawn).to receive(:run!).with("echo", nil => "test")
- subject.run!("echo", nil => "test")
+ described_class.run!("echo", nil => "test")
end
end
end