From 74281b6f1eb1e67d99a3b713041296c871c1e245 Mon Sep 17 00:00:00 2001 From: Rob Sanheim Date: Fri, 11 Mar 2011 15:16:31 -0500 Subject: [PATCH] Start implementing config --- lib/nachos/cli.rb | 9 +++++++-- spec/nachos/cli_spec.rb | 11 +++++++++++ spec/spec_helper.rb | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/nachos/cli.rb b/lib/nachos/cli.rb index 1cf76f6..3260ce9 100644 --- a/lib/nachos/cli.rb +++ b/lib/nachos/cli.rb @@ -1,6 +1,6 @@ class Nachos::CLI < Thor - attr_reader :config, :main + attr_reader :main class_option :dry_run, :type => :boolean, :default => false, :desc => "If specified, the converter will just print the commands and not actually execute them" def initialize(*args) @@ -25,7 +25,12 @@ def sync shell.say main.github_summary main.sync end - + + desc "config", "Create default config (if it doesn't exist)" + def config + main.config + end + private def dry_run? diff --git a/spec/nachos/cli_spec.rb b/spec/nachos/cli_spec.rb index dc17f7f..fca77a9 100644 --- a/spec/nachos/cli_spec.rb +++ b/spec/nachos/cli_spec.rb @@ -69,4 +69,15 @@ cli.shell.output.should include("sync summary") end end + + describe "config" do + it "calls config on main" do + main = stub_everything + main.expects(:config) + Nachos::CLI.any_instance.stubs(:main).returns(main) + cli = Nachos::CLI.new + cli.invoke(:config) + end + end end + \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c345331..b6e52c1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -15,6 +15,7 @@ config.alias_example_to :fit, :focused => true config.filter_run :focused => true config.run_all_when_everything_filtered = true + # config.full_backtrace = true end class FakeShell