spec/lib/hackpad/cli/runner_spec.rb in hackpad-cli-0.1.2 vs spec/lib/hackpad/cli/runner_spec.rb in hackpad-cli-0.1.3

- old
+ new

@@ -24,10 +24,17 @@ cli.shell.mute do cli.search 'xxx' end end + it 'calls the add method in client class' do + Object.stub(:add) + cli.shell.mute do + cli.add + end + end + it 'calls the workspaces method in client class' do Object.stub(:workspaces) cli.shell.mute do cli.workspaces end @@ -53,10 +60,11 @@ cli.getnew end end it 'calls the version method in client class' do - STDOUT.stub(:puts).with(Hackpad::Cli::VERSION) + version = File.read(File.expand_path('../../../../../CHANGELOG.md', __FILE__))[/([0-9]+\.[0-9]+\.[0-9]+)/] + STDOUT.stub(:puts).with(version) cli.shell.mute do cli.version end end