diff --git a/lib/gooddata/cli/hooks.rb b/lib/gooddata/cli/hooks.rb index 65cd75157..4fc4a8c23 100644 --- a/lib/gooddata/cli/hooks.rb +++ b/lib/gooddata/cli/hooks.rb @@ -40,8 +40,8 @@ # Error logic here # return false to skip default error handling # binding.pry - # pp exception.backtrace - # pp exception + pp exception.backtrace + pp exception true end end diff --git a/spec/helpers/cli_helper.rb b/spec/helpers/cli_helper.rb index 078665225..247ef96bc 100644 --- a/spec/helpers/cli_helper.rb +++ b/spec/helpers/cli_helper.rb @@ -8,13 +8,16 @@ module CliHelper # @returns Captured output as string def capture_stdout(&block) original_stdout = $stdout - $stdout = fake = StringIO.new + original_stderr = $stderr + $stdout = $stderr = StringIO.new + begin yield + $stdout.string ensure $stdout = original_stdout + $stderr = original_stderr end - fake.string end # Run CLI with arguments and return captured stdout diff --git a/spec/unit/cli/commands/cmd_api_spec.rb b/spec/unit/cli/commands/cmd_api_spec.rb index bae301b9f..85be1b3ff 100644 --- a/spec/unit/cli/commands/cmd_api_spec.rb +++ b/spec/unit/cli/commands/cmd_api_spec.rb @@ -2,7 +2,7 @@ require 'gooddata/cli/cli' -describe 'GoodData::CLI - api', :broken => true do +describe 'GoodData::CLI - api' do describe 'api' do it 'Complains when no subcommand specified' do args = %w(api) diff --git a/spec/unit/cli/commands/cmd_auth_spec.rb b/spec/unit/cli/commands/cmd_auth_spec.rb index 602957def..7fd940397 100644 --- a/spec/unit/cli/commands/cmd_auth_spec.rb +++ b/spec/unit/cli/commands/cmd_auth_spec.rb @@ -2,7 +2,7 @@ require 'gooddata/cli/cli' -describe 'GoodData::CLI - auth', :broken => true do +describe 'GoodData::CLI - auth' do describe 'auth' do it 'Can be called without arguments' do args = %w(auth) diff --git a/spec/unit/cli/commands/cmd_domain_spec.rb b/spec/unit/cli/commands/cmd_domain_spec.rb index fff8eb806..bce188ce2 100644 --- a/spec/unit/cli/commands/cmd_domain_spec.rb +++ b/spec/unit/cli/commands/cmd_domain_spec.rb @@ -2,7 +2,7 @@ require 'gooddata/cli/cli' -describe 'GoodData::CLI - domain', :broken => true do +describe 'GoodData::CLI - domain' do describe 'domain' do it 'Complains when no subcommand specified' do args = %w(domain) diff --git a/spec/unit/cli/commands/cmd_process_spec.rb b/spec/unit/cli/commands/cmd_process_spec.rb index 4827db0a6..142500dcf 100644 --- a/spec/unit/cli/commands/cmd_process_spec.rb +++ b/spec/unit/cli/commands/cmd_process_spec.rb @@ -2,7 +2,7 @@ require 'gooddata/cli/cli' -describe 'GoodData::CLI - process', :broken => true do +describe 'GoodData::CLI - process' do describe 'process' do it 'Complains when no subcommand specified' do args = %w(process) diff --git a/spec/unit/cli/commands/cmd_project_spec.rb b/spec/unit/cli/commands/cmd_project_spec.rb index 406dfff6c..a60955900 100644 --- a/spec/unit/cli/commands/cmd_project_spec.rb +++ b/spec/unit/cli/commands/cmd_project_spec.rb @@ -2,7 +2,7 @@ require 'gooddata/cli/cli' -describe 'GoodData::CLI - project', :broken => true do +describe 'GoodData::CLI - project' do describe 'project' do it 'Complains when no subcommand specified' do args = %w(project) diff --git a/spec/unit/cli/commands/cmd_role_spec.rb b/spec/unit/cli/commands/cmd_role_spec.rb deleted file mode 100644 index 05ba9b828..000000000 --- a/spec/unit/cli/commands/cmd_role_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -# encoding: UTF-8 - -require 'gooddata/cli/cli' - -describe GoodData::CLI, :broken => true do - describe 'role' do - it 'Complains when no parameters specified' do - args = %w(role) - - out = run_cli(args) - out.should include "Command 'role' requires a subcommand list" - end - - describe 'role list' do - it 'Complains when no project ID specified' do - args = [ - '-U', - ConnectionHelper::DEFAULT_USERNAME, - '-P', - ConnectionHelper::DEFAULT_PASSWORD, - 'role', - 'list' - ] - - out = run_cli(args) - out.should include 'Project ID has to be provided' - end - - it 'List roles when passing project ID' do - pending 'Investignate which project to use' - - args = [ - '-U', - ConnectionHelper::DEFAULT_USERNAME, - '-P', - ConnectionHelper::DEFAULT_PASSWORD, - '-p', - ProjectHelper::PROJECT_ID, - 'role', - 'list', - ] - - out = run_cli(args) - - expected_roles = [ - 'adminRole,/gdc/projects/tk6192gsnav58crp6o1ahsmtuniq8khb/roles/2' - ] - - expected_roles.each do |expected_role| - out.should include expected_role - end - end - end - end -end \ No newline at end of file diff --git a/spec/unit/cli/commands/cmd_run_ruby_spec.rb b/spec/unit/cli/commands/cmd_run_ruby_spec.rb index 248b6be0c..92b6f338a 100644 --- a/spec/unit/cli/commands/cmd_run_ruby_spec.rb +++ b/spec/unit/cli/commands/cmd_run_ruby_spec.rb @@ -2,7 +2,7 @@ require 'gooddata/cli/cli' -describe 'GoodData::CLI - run_ruby', :broken => true do +describe 'GoodData::CLI - run_ruby' do describe 'run_ruby' do it 'Can be called without arguments' do args = %w(run_ruby) diff --git a/spec/unit/cli/commands/cmd_scaffold_spec.rb b/spec/unit/cli/commands/cmd_scaffold_spec.rb index b486ed5c1..7bf314f88 100644 --- a/spec/unit/cli/commands/cmd_scaffold_spec.rb +++ b/spec/unit/cli/commands/cmd_scaffold_spec.rb @@ -2,7 +2,7 @@ require 'gooddata/cli/cli' -describe 'GoodData::CLI - scaffold', :broken => true do +describe 'GoodData::CLI - scaffold' do TEST_PROJECT_NAME = 'test-project' TEST_BRICK_NAME = 'test-brick' diff --git a/spec/unit/cli/commands/cmd_user_spec.rb b/spec/unit/cli/commands/cmd_user_spec.rb index 3f6581c2d..fdd3b5d9b 100644 --- a/spec/unit/cli/commands/cmd_user_spec.rb +++ b/spec/unit/cli/commands/cmd_user_spec.rb @@ -1,6 +1,6 @@ require 'gooddata/cli/cli' -describe 'GoodData::CLI - user', :broken => true do +describe 'GoodData::CLI - user' do describe 'user' do it 'Complains when no subcommand specified' do args = %w(user)