Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
Start implementing config
Browse files Browse the repository at this point in the history
  • Loading branch information
rsanheim committed Mar 11, 2011
1 parent 60af048 commit 74281b6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
9 changes: 7 additions & 2 deletions 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)
Expand All @@ -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?
Expand Down
11 changes: 11 additions & 0 deletions spec/nachos/cli_spec.rb
Expand Up @@ -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

1 change: 1 addition & 0 deletions spec/spec_helper.rb
Expand Up @@ -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
Expand Down

0 comments on commit 74281b6

Please sign in to comment.