Sha256: 1d60fa87f9b948dd0908f3d18e6d7508792487233033b53a8c40f1971fce089b

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

require "spec_helper"
require "shelly/cli/main"

describe Shelly::CLI::Main do
  before do
    @main = Shelly::CLI::Main.new
  end

  describe "#version" do
    it "should return shelly's version" do
      $stdout.should_receive(:puts).with("shelly version #{Shelly::VERSION}")
      @main.version
    end
  end

  describe "#register" do
    it "should invoke account:register command" do
      @main.should_receive(:invoke).with("account:register")
      @main.register
    end
  end

  describe "#add" do
    it "should invoke apps:add command" do
      @main.should_receive(:invoke).with("apps:add")
      @main.add
    end
  end



  describe "#help" do
    it "should display available commands" do
      expected = <<-OUT
Tasks:
  shelly account <command>  # Manages your account
  shelly add                # Adds new application to Shelly Cloud
  shelly apps <command>     # Manages your applications
  shelly help [TASK]        # Describe available tasks or one specific task
  shelly register           # Registers new user account on Shelly Cloud
  shelly version            # Displays shelly version
OUT
      out = IO.popen("bin/shelly").read.strip
      out.should == expected.strip
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shelly-0.0.6 spec/shelly/cli/main_spec.rb