diff --git a/.gitignore b/.gitignore index faa8f4e..618329e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,8 @@ pkg/* features/config/secrets.yml .idea spec/tmp -spec/reports/ +spec/reports .vagrant .kitchen -.env \ No newline at end of file +.env +/tmp \ No newline at end of file diff --git a/lib/lobot/wizard.rb b/lib/lobot/wizard.rb new file mode 100644 index 0000000..b7f9b98 --- /dev/null +++ b/lib/lobot/wizard.rb @@ -0,0 +1,11 @@ +module Lobot + class Wizard + attr_reader :config + + def initialize(config) + @config = config + end + + def + end +end \ No newline at end of file diff --git a/spec/helpers/io_helpers.rb b/spec/helpers/io_helpers.rb new file mode 100644 index 0000000..5541f07 --- /dev/null +++ b/spec/helpers/io_helpers.rb @@ -0,0 +1,14 @@ +module IOHelpers + def capture(stream = :stdout) + begin + stream = stream.to_s + eval "$#{stream} = StringIO.new" + yield + result = eval("$#{stream}").string + ensure + eval("$#{stream} = #{stream.upcase}") + end + + result + end +end diff --git a/spec/lib/lobot/wizard_spec.rb b/spec/lib/lobot/wizard_spec.rb new file mode 100644 index 0000000..61be0f9 --- /dev/null +++ b/spec/lib/lobot/wizard_spec.rb @@ -0,0 +1,13 @@ +require "spec_helper" + +describe Lobot::Wizard do + let(:lobot_config) { Lobot::Config.new } + + subject { Lobot::Wizard.new(lobot_config) } + + describe "#prompt_for_build_name" do + it "accepts the name of the build" do + capture { subject.prompt_for_build_name } + end + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 87f8d15..bce96a4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,3 +4,9 @@ require "lobot/cli" require "godot" require "tempfile" + +Dir.glob(File.expand_path("../helpers/**/*.rb", __FILE__)).each { |h| require h} + +RSpec.configure do |config| + config.include IOHelpers +end