<commit_before># encoding: UTF-8

require 'gooddata/cli/cli'

describe GoodData::CLI 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 = %w(role list)

        out = run_cli(args)
        out.should include 'Project ID has to be provided'
      end

      it 'List roles when passing project ID' do
        args = [
          '-p',
          ProjectHelper::PROJECT_ID,
          'role',
          'list',
        ]

        out = run_cli(args)
        out.should include 'dashboardOnlyRole,/gdc/projects/la84vcyhrq8jwbu4wpipw66q2sqeb923/roles/3'
        out.should include 'readOnlyUserRole,/gdc/projects/la84vcyhrq8jwbu4wpipw66q2sqeb923/roles/7'
      end
    end
  end
end<commit_msg>Disabled test until test environment setup will be done ...<commit_after># encoding: UTF-8

require 'gooddata/cli/cli'

describe GoodData::CLI 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 = %w(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 = [
          '-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
{'fraction_non_alphanumeric': 0.08291203235591507, 'fraction_numerical': 0.017189079878665317, 'mean_word_length': 2.156299840510367, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '397848', 'n_tokens_mistral': 648, 'n_tokens_neox': 617, 'n_words': 181}