spec/spec_helper.rb in rconf-0.7.6 vs spec/spec_helper.rb in rconf-0.7.8
- old
+ new
@@ -17,5 +17,38 @@
RSpec.configure do |c|
c.mock_with(:flexmock)
end
+# Helper method to mock Command.execute
+#
+# === Parameters
+# Parameters are passed through to flexmock 'with' method
+#
+# === Return
+# mock(Flexmock):: Corresponding flexmock instance
+def should_execute(*with)
+ mock = flexmock(RightConf::Command.instance).should_receive(:execute).with(*with)
+end
+
+# Helper method to mock Command.execute_in_ruby
+#
+# === Parameters
+# Parameters are passed through to flexmock 'with' method
+#
+# === Return
+# mock(Flexmock):: Corresponding flexmock instance
+def should_execute_in_ruby(*with)
+ mock = flexmock(RightConf::Command.instance).should_receive(:execute_in_ruby).with(*with)
+end
+
+# Helper method to mock Command.sudo
+#
+# === Parameters
+# Parameters are passed through to flexmock 'with' method
+#
+# === Return
+# mock(Flexmock):: Corresponding flexmock instance
+def should_sudo(*with)
+ mock = flexmock(RightConf::Command.instance).should_receive(:sudo).with(*with)
+end
+