spec/spec_helper.rb in vmc-0.5.0.rc4 vs spec/spec_helper.rb in vmc-0.5.0
- old
+ new
@@ -24,10 +24,12 @@
end
RSpec.configure do |c|
c.include Fake::FakeMethods
c.include V1Fake::FakeMethods
+ c.include ConsoleAppSpeckerMatchers
+
c.mock_with :rr
if RUBY_VERSION =~ /^1\.8\.\d/
c.filter_run_excluding :ruby19 => true
end
@@ -44,40 +46,15 @@
c.before do
VMC::CLI.send(:class_variable_set, :@@client, nil)
end
end
-class String
- def strip_heredoc
- min = scan(/^[ \t]*(?=\S)/).min
- indent = min ? min.size : 0
- gsub(/^[ \t]{#{indent}}/, '')
- end
-
- def strip_progress_dots
- gsub(/\. \x08([\x08\. ]+)/, "... ")
- end
-end
-
def name_list(xs)
if xs.empty?
"none"
else
xs.collect(&:name).join(", ")
end
-end
-
-def invoke_cli(cli, *args)
- stub.proxy(cli).invoke.with_any_args
- stub(cli.class).new { cli }
- cli.invoke(*args)
-end
-
-def stub_output(cli)
- stub(cli).print
- stub(cli).puts
- stub(Interact::Progress::Dots).start!
- stub(Interact::Progress::Dots).stop!
end
def run(command)
SpeckerRunner.new(command) do |runner|
yield runner