Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Start implementing config

  • Loading branch information...
commit 74281b6f1eb1e67d99a3b713041296c871c1e245 1 parent 60af048
@rsanheim authored
View
9 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?
View
11 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
+
View
1  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
Please sign in to comment.
Something went wrong with that request. Please try again.