spec/common_spec.rb in linux_admin-0.8.1 vs spec/common_spec.rb in linux_admin-0.9.0
- old
+ new
@@ -1,25 +1,12 @@
require 'spec_helper'
describe LinuxAdmin::Common do
- before do
- class TestClass
- extend LinuxAdmin::Common
- end
- end
+ subject { Class.new { include LinuxAdmin::Common }.new }
- after do
- Object.send(:remove_const, :TestClass)
- end
-
- subject { TestClass }
-
context "#cmd" do
it "looks up local command from id" do
- d = double(LinuxAdmin::Distros::Distro)
- d.class::COMMANDS = {:sh => '/bin/sh'}
- LinuxAdmin::Distros::Distro.should_receive(:local).and_return(d)
- subject.cmd(:sh).should == '/bin/sh'
+ expect(subject.cmd(:dd)).to match(/bin\/dd/)
end
end
it "#run" do
AwesomeSpawn.should_receive(:run).with("echo", nil => "test")