Permalink
Browse files

wip - add basis of wizard

  • Loading branch information...
1 parent 6e00ce9 commit 362ad99a35d0d3d4a99f86f9f5ccf321e986f477 @ohrite ohrite committed Dec 2, 2012
Showing with 47 additions and 2 deletions.
  1. +3 −2 .gitignore
  2. +11 −0 lib/lobot/wizard.rb
  3. +14 −0 spec/helpers/io_helpers.rb
  4. +13 −0 spec/lib/lobot/wizard_spec.rb
  5. +6 −0 spec/spec_helper.rb
View
@@ -5,7 +5,8 @@ pkg/*
features/config/secrets.yml
.idea
spec/tmp
-spec/reports/
+spec/reports
.vagrant
.kitchen
-.env
+.env
+/tmp
View
@@ -0,0 +1,11 @@
+module Lobot
+ class Wizard
+ attr_reader :config
+
+ def initialize(config)
+ @config = config
+ end
+
+ def
+ end
+end
@@ -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
@@ -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
View
@@ -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

0 comments on commit 362ad99

Please sign in to comment.