gooddata 0.6.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.rubocop.yml +23 -0
- data/.travis.yml +9 -4
- data/CLI.md +439 -0
- data/Gemfile +0 -1
- data/README.md +2 -2
- data/Rakefile +60 -8
- data/doc/templates/default/module/setup.rb +1 -1
- data/examples.rb +2 -0
- data/gooddata +2 -0
- data/gooddata.gemspec +12 -8
- data/lib/gooddata.rb +0 -2
- data/lib/gooddata/bricks/base_downloader.rb +52 -47
- data/lib/gooddata/bricks/brick.rb +20 -31
- data/lib/gooddata/bricks/bricks.rb +1 -1
- data/lib/gooddata/bricks/middleware/base_middleware.rb +9 -7
- data/lib/gooddata/bricks/middleware/bench_middleware.rb +12 -10
- data/lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb +28 -28
- data/lib/gooddata/bricks/middleware/fs_upload_middleware.rb +20 -16
- data/lib/gooddata/bricks/middleware/gooddata_middleware.rb +21 -19
- data/lib/gooddata/bricks/middleware/logger_middleware.rb +10 -8
- data/lib/gooddata/bricks/middleware/restforce_middleware.rb +36 -34
- data/lib/gooddata/bricks/middleware/stdout_middleware.rb +11 -9
- data/lib/gooddata/bricks/middleware/twitter_middleware.rb +14 -12
- data/lib/gooddata/bricks/pipeline.rb +28 -0
- data/lib/gooddata/bricks/utils.rb +10 -8
- data/lib/gooddata/cli/cli.rb +1 -6
- data/lib/gooddata/cli/commands/auth_cmd.rb +1 -1
- data/lib/gooddata/cli/commands/console_cmd.rb +7 -5
- data/lib/gooddata/cli/commands/domain_cmd.rb +45 -0
- data/lib/gooddata/cli/commands/process_cmd.rb +42 -5
- data/lib/gooddata/cli/commands/project_cmd.rb +96 -36
- data/lib/gooddata/cli/commands/projects_cmd.rb +21 -0
- data/lib/gooddata/cli/commands/role_cmd.rb +28 -0
- data/lib/gooddata/cli/commands/run_ruby_cmd.rb +5 -5
- data/lib/gooddata/cli/commands/scaffold_cmd.rb +1 -1
- data/lib/gooddata/cli/commands/{profile_cmd.rb → user_cmd.rb} +7 -9
- data/lib/gooddata/cli/shared.rb +3 -2
- data/lib/gooddata/client.rb +16 -304
- data/lib/gooddata/commands/api.rb +13 -5
- data/lib/gooddata/commands/auth.rb +47 -40
- data/lib/gooddata/commands/base.rb +4 -2
- data/lib/gooddata/commands/commands.rb +1 -1
- data/lib/gooddata/commands/datasets.rb +20 -7
- data/lib/gooddata/commands/domain.rb +23 -0
- data/lib/gooddata/commands/process.rb +23 -117
- data/lib/gooddata/commands/project.rb +147 -0
- data/lib/gooddata/commands/projects.rb +8 -102
- data/lib/gooddata/commands/role.rb +26 -0
- data/lib/gooddata/commands/runners.rb +41 -38
- data/lib/gooddata/commands/scaffold.rb +46 -43
- data/lib/gooddata/commands/user.rb +33 -0
- data/lib/gooddata/connection.rb +43 -353
- data/lib/gooddata/core/connection.rb +389 -0
- data/lib/gooddata/core/core.rb +5 -4
- data/lib/gooddata/core/logging.rb +48 -0
- data/lib/gooddata/core/nil_logger.rb +13 -0
- data/lib/gooddata/core/project.rb +70 -0
- data/lib/gooddata/core/rest.rb +120 -0
- data/lib/gooddata/core/threaded.rb +14 -0
- data/lib/gooddata/core/user.rb +19 -0
- data/lib/gooddata/data/data.rb +2 -1
- data/lib/gooddata/data/guesser.rb +16 -12
- data/lib/gooddata/exceptions/command_failed.rb +1 -1
- data/lib/gooddata/exceptions/exceptions.rb +2 -1
- data/lib/gooddata/exceptions/no_project_error.rb +11 -0
- data/lib/gooddata/exceptions/project_not_found.rb +1 -1
- data/lib/gooddata/extensions/big_decimal.rb +6 -2
- data/lib/gooddata/extract.rb +10 -8
- data/lib/gooddata/goodzilla/goodzilla.rb +61 -59
- data/lib/gooddata/helpers.rb +15 -9
- data/lib/gooddata/models/account_settings.rb +124 -0
- data/lib/gooddata/models/attributes/anchor.rb +37 -0
- data/lib/gooddata/models/attributes/attributes.rb +8 -0
- data/lib/gooddata/models/attributes/date_attribute.rb +25 -0
- data/lib/gooddata/models/attributes/time_attribute.rb +24 -0
- data/lib/gooddata/models/columns/attribute.rb +71 -0
- data/lib/gooddata/models/columns/columns.rb +8 -0
- data/lib/gooddata/models/columns/date_column.rb +63 -0
- data/lib/gooddata/models/columns/fact_model.rb +54 -0
- data/lib/gooddata/models/columns/label.rb +55 -0
- data/lib/gooddata/models/columns/reference.rb +57 -0
- data/lib/gooddata/models/dashboard_builder.rb +26 -0
- data/lib/gooddata/models/data_result.rb +10 -9
- data/lib/gooddata/models/domain.rb +131 -0
- data/lib/gooddata/models/empty_result.rb +5 -8
- data/lib/gooddata/models/facts/facts.rb +8 -0
- data/lib/gooddata/models/facts/time_fact.rb +20 -0
- data/lib/gooddata/models/folders/attribute_folder.rb +20 -0
- data/lib/gooddata/models/folders/fact_folder.rb +20 -0
- data/lib/gooddata/models/folders/folders.rb +8 -0
- data/lib/gooddata/models/invitation.rb +78 -0
- data/lib/gooddata/models/links.rb +6 -6
- data/lib/gooddata/models/md_object.rb +25 -0
- data/lib/gooddata/models/metadata.rb +160 -62
- data/lib/gooddata/models/metadata/attribute.rb +81 -0
- data/lib/gooddata/models/metadata/column.rb +61 -0
- data/lib/gooddata/models/{dashboard.rb → metadata/dashboard.rb} +12 -7
- data/lib/gooddata/models/{data_set.rb → metadata/data_set.rb} +5 -4
- data/lib/gooddata/models/metadata/date_dimension.rb +26 -0
- data/lib/gooddata/models/metadata/display_form.rb +61 -0
- data/lib/gooddata/models/metadata/fact.rb +36 -0
- data/lib/gooddata/models/metadata/folder.rb +24 -0
- data/lib/gooddata/models/metadata/metadata.rb +8 -0
- data/lib/gooddata/models/metadata/metric.rb +197 -0
- data/lib/gooddata/models/metadata/report.rb +115 -0
- data/lib/gooddata/models/{report_definition.rb → metadata/report_definition.rb} +16 -10
- data/lib/gooddata/models/metadata/schema.rb +227 -0
- data/lib/gooddata/models/model.rb +38 -1339
- data/lib/gooddata/models/models.rb +5 -2
- data/lib/gooddata/models/module_constants.rb +29 -0
- data/lib/gooddata/models/process.rb +142 -13
- data/lib/gooddata/models/profile.rb +4 -6
- data/lib/gooddata/models/project.rb +406 -136
- data/lib/gooddata/models/project_blueprint.rb +221 -0
- data/lib/gooddata/models/project_builder.rb +136 -0
- data/lib/gooddata/models/project_creator.rb +138 -0
- data/lib/gooddata/models/project_metadata.rb +11 -10
- data/lib/gooddata/models/project_role.rb +92 -0
- data/lib/gooddata/models/references/date_reference.rb +44 -0
- data/lib/gooddata/models/references/references.rb +8 -0
- data/lib/gooddata/models/references/time_reference.rb +13 -0
- data/lib/gooddata/models/report_data_result.rb +11 -11
- data/lib/gooddata/models/schedule.rb +284 -0
- data/lib/gooddata/models/schema_blueprint.rb +158 -0
- data/lib/gooddata/models/schema_builder.rb +81 -0
- data/lib/gooddata/models/tab_builder.rb +23 -0
- data/lib/gooddata/models/user.rb +165 -0
- data/lib/gooddata/version.rb +1 -1
- data/lib/templates/project/data/devs.csv +1 -1
- data/lib/templates/project/data/repos.csv +1 -1
- data/lib/templates/project/model/model.rb.erb +7 -11
- data/spec/bricks/bricks_spec.rb +2 -0
- data/spec/data/test-ci-data.csv +2 -0
- data/spec/data/test_project_model_spec.json +7 -27
- data/spec/helpers/blueprint_helper.rb +2 -0
- data/spec/helpers/cli_helper.rb +2 -0
- data/spec/helpers/connection_helper.rb +14 -1
- data/spec/helpers/project_helper.rb +16 -0
- data/spec/helpers/schema_helper.rb +16 -0
- data/spec/integration/command_projects_spec.rb +7 -7
- data/spec/integration/create_from_template_spec.rb +2 -2
- data/spec/integration/full_project_spec.rb +160 -7
- data/spec/integration/partial_md_export_import_spec.rb +3 -3
- data/spec/logging_in_logging_out_spec.rb +2 -1
- data/spec/spec_helper.rb +26 -4
- data/spec/unit/bricks/bricks_spec.rb +15 -7
- data/spec/unit/bricks/middleware/bench_middleware_spec.rb +2 -0
- data/spec/unit/bricks/middleware/bulk_salesforce_middleware_spec.rb +2 -0
- data/spec/unit/bricks/middleware/gooddata_middleware_spec.rb +2 -0
- data/spec/unit/bricks/middleware/logger_middleware_spec.rb +2 -0
- data/spec/unit/bricks/middleware/restforce_middleware_spec.rb +2 -0
- data/spec/unit/bricks/middleware/stdout_middleware_spec.rb +2 -0
- data/spec/unit/bricks/middleware/twitter_middleware_spec.rb +2 -0
- data/spec/unit/cli/cli_spec.rb +2 -0
- data/spec/unit/cli/commands/cmd_api_spec.rb +23 -15
- data/spec/unit/cli/commands/cmd_auth_spec.rb +8 -4
- data/spec/unit/cli/commands/cmd_domain_spec.rb +82 -0
- data/spec/unit/cli/commands/cmd_process_spec.rb +29 -13
- data/spec/unit/cli/commands/cmd_project_spec.rb +51 -30
- data/spec/unit/cli/commands/cmd_role_spec.rb +44 -0
- data/spec/unit/cli/commands/cmd_run_ruby_spec.rb +8 -4
- data/spec/unit/cli/commands/cmd_scaffold_spec.rb +48 -11
- data/spec/unit/cli/commands/cmd_user_spec.rb +29 -0
- data/spec/unit/commands/command_api_spec.rb +1 -1
- data/spec/unit/commands/command_auth_spec.rb +100 -18
- data/spec/unit/commands/command_dataset_spec.rb +4 -0
- data/spec/unit/commands/command_process_spec.rb +9 -4
- data/spec/unit/commands/command_projects_spec.rb +10 -6
- data/spec/unit/commands/command_scaffold_spec.rb +5 -1
- data/spec/unit/commands/command_user_spec.rb +22 -0
- data/spec/unit/core/connection_spec.rb +35 -6
- data/spec/unit/core/logging_spec.rb +65 -0
- data/spec/unit/core/nil_logger_spec.rb +9 -0
- data/spec/unit/core/project_spec.rb +51 -0
- data/spec/unit/core/rest_spec.rb +33 -0
- data/spec/unit/data/guesser_spec.rb +5 -0
- data/spec/unit/godzilla/goodzilla_spec.rb +2 -0
- data/spec/unit/models/account_settings_spec.rb +28 -0
- data/spec/unit/models/anchor_spec.rb +32 -0
- data/spec/unit/models/attribute_column_spec.rb +7 -0
- data/spec/unit/models/domain_spec.rb +45 -0
- data/spec/unit/models/invitation_spec.rb +13 -0
- data/spec/unit/models/md_object_spec.rb +47 -0
- data/spec/unit/models/metric.rb +92 -0
- data/spec/unit/{model → models}/model_spec.rb +9 -7
- data/spec/unit/models/project_blueprint_spec.rb +202 -0
- data/spec/unit/models/project_creator.rb +73 -0
- data/spec/unit/models/project_role_spec.rb +90 -0
- data/spec/unit/models/project_spec.rb +143 -0
- data/spec/unit/models/schedule_spec.rb +491 -0
- data/spec/unit/{model → models}/schema_builder_spec.rb +2 -0
- data/spec/unit/{model → models}/tools_spec.rb +13 -7
- data/spec/unit/models/user_spec.rb +16 -0
- data/test/test_upload.rb +2 -0
- metadata +189 -86
- data/lib/gooddata/commands/profile.rb +0 -11
- data/lib/gooddata/models/attribute.rb +0 -29
- data/lib/gooddata/models/display_form.rb +0 -9
- data/lib/gooddata/models/fact.rb +0 -19
- data/lib/gooddata/models/metric.rb +0 -99
- data/lib/gooddata/models/report.rb +0 -89
- data/spec/data/blueprint_valid.json +0 -37
- data/spec/unit/cli/commands/cmd_profile_spec.rb +0 -16
- data/spec/unit/commands/command_profile_spec.rb +0 -18
- data/spec/unit/core/core_spec.rb +0 -7
- data/spec/unit/model/blueprint_spec.rb +0 -132
- data/spec/unit/model/project_blueprint_spec.rb +0 -44
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
1
3
|
require 'simplecov'
|
2
4
|
require 'rspec'
|
3
5
|
require 'coveralls'
|
4
6
|
require 'pathname'
|
5
7
|
|
6
|
-
Coveralls.
|
8
|
+
Coveralls.wear_merged!
|
7
9
|
|
8
10
|
# Automagically include all helpers/*_helper.rb
|
9
11
|
|
@@ -13,9 +15,28 @@ Dir.glob(base + 'helpers/*_helper.rb').each do |file|
|
|
13
15
|
end
|
14
16
|
|
15
17
|
RSpec.configure do |config|
|
16
|
-
include BlueprintHelper
|
17
|
-
include CliHelper
|
18
|
-
include ConnectionHelper
|
18
|
+
config.include BlueprintHelper
|
19
|
+
config.include CliHelper
|
20
|
+
config.include ConnectionHelper
|
21
|
+
config.include ProjectHelper
|
22
|
+
config.include SchemaHelper
|
23
|
+
|
24
|
+
config.before(:all) do
|
25
|
+
# TODO: Fully setup global environment
|
26
|
+
GoodData.logging_off
|
27
|
+
end
|
28
|
+
|
29
|
+
config.after(:all) do
|
30
|
+
# TODO: Fully setup global environment
|
31
|
+
end
|
32
|
+
|
33
|
+
config.before(:suite) do
|
34
|
+
# TODO: Setup test project
|
35
|
+
end
|
36
|
+
|
37
|
+
config.after(:suite) do
|
38
|
+
# TODO: Delete test project
|
39
|
+
end
|
19
40
|
end
|
20
41
|
|
21
42
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
@@ -28,6 +49,7 @@ SimpleCov.start do
|
|
28
49
|
add_filter 'test/'
|
29
50
|
|
30
51
|
add_group 'Bricks', 'lib/gooddata/bricks'
|
52
|
+
add_group 'Middleware', 'lib/gooddata/bricks/middleware'
|
31
53
|
add_group 'CLI', 'lib/gooddata/cli'
|
32
54
|
add_group 'Commands', 'lib/gooddata/commands'
|
33
55
|
add_group 'Core', 'lib/gooddata/core'
|
@@ -1,22 +1,30 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
1
3
|
require 'gooddata/bricks/bricks'
|
2
4
|
|
3
|
-
describe GoodData::Bricks do
|
5
|
+
describe GoodData::Bricks::Brick do
|
4
6
|
it "Has GoodData::Bricks::Brick class" do
|
5
7
|
GoodData::Bricks::Brick.should_not == nil
|
6
8
|
end
|
7
9
|
|
8
|
-
|
10
|
+
describe '#version' do
|
11
|
+
it 'Throws NotImplemented on base class' do
|
12
|
+
brick = GoodData::Bricks::Brick.new
|
13
|
+
expect do
|
14
|
+
brick.version
|
15
|
+
end.to raise_error(NotImplementedError)
|
16
|
+
end
|
17
|
+
end
|
9
18
|
|
10
|
-
|
19
|
+
it "should be possible to execute custom brick" do
|
20
|
+
class CustomBrick < GoodData::Bricks::Brick
|
11
21
|
|
12
22
|
def call(params)
|
13
|
-
puts
|
23
|
+
puts 'hello'
|
14
24
|
end
|
15
25
|
end
|
16
26
|
|
17
|
-
|
18
|
-
|
19
|
-
p = GoodData::Bricks::Pipeline.prepare([GoodData::Bricks::BenchMiddleware, DummyBrick])
|
27
|
+
p = GoodData::Bricks::Pipeline.prepare([CustomBrick])
|
20
28
|
|
21
29
|
p.call({})
|
22
30
|
end
|
data/spec/unit/cli/cli_spec.rb
CHANGED
@@ -1,28 +1,36 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
1
3
|
require 'gooddata/cli/cli'
|
2
4
|
|
3
|
-
describe GoodData::CLI do
|
4
|
-
|
5
|
-
|
5
|
+
describe 'GoodData::CLI - api' do
|
6
|
+
describe 'api' do
|
7
|
+
it 'Complains when no subcommand specified' do
|
8
|
+
args = %w(api)
|
6
9
|
|
7
|
-
|
8
|
-
|
10
|
+
out = run_cli(args)
|
11
|
+
out.should include("Command 'api' requires a subcommand info,get")
|
12
|
+
end
|
9
13
|
end
|
10
14
|
|
11
|
-
|
12
|
-
|
15
|
+
describe 'api info' do
|
16
|
+
it 'Can be called without arguments' do
|
17
|
+
args = %w(api info)
|
13
18
|
|
14
|
-
|
19
|
+
run_cli(args)
|
20
|
+
end
|
15
21
|
end
|
16
22
|
|
17
|
-
|
18
|
-
|
23
|
+
describe 'api get' do
|
24
|
+
it 'Can be called without arguments' do
|
25
|
+
args = %w(api get)
|
19
26
|
|
20
|
-
|
21
|
-
|
27
|
+
run_cli(args)
|
28
|
+
end
|
22
29
|
|
23
|
-
|
24
|
-
|
30
|
+
it 'Is able to get /gdc' do
|
31
|
+
args = %w(api get /gdc)
|
25
32
|
|
26
|
-
|
33
|
+
run_cli(args)
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
@@ -1,9 +1,13 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
1
3
|
require 'gooddata/cli/cli'
|
2
4
|
|
3
|
-
describe GoodData::CLI do
|
4
|
-
|
5
|
-
|
5
|
+
describe 'GoodData::CLI - auth' do
|
6
|
+
describe 'auth' do
|
7
|
+
it 'Can be called without arguments' do
|
8
|
+
args = %w(auth)
|
6
9
|
|
7
|
-
|
10
|
+
run_cli(args)
|
11
|
+
end
|
8
12
|
end
|
9
13
|
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'gooddata/cli/cli'
|
4
|
+
|
5
|
+
describe 'GoodData::CLI - domain' do
|
6
|
+
describe 'domain' do
|
7
|
+
it 'Complains when no subcommand specified' do
|
8
|
+
args = %w(domain)
|
9
|
+
|
10
|
+
out = run_cli(args)
|
11
|
+
out.should include "Command 'domain' requires a subcommand add_user,list_users"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "domain add_user" do
|
16
|
+
TEST_DOMAIN = 'gooddata'
|
17
|
+
TEST_EMAIL = 'joe.doe@gooddata.com'
|
18
|
+
TEST_PASSWORD = 'p4ssw0rth'
|
19
|
+
|
20
|
+
it "Outputs 'Domain name has to be provided' if none specified" do
|
21
|
+
args = %w(domain add_user)
|
22
|
+
|
23
|
+
out = run_cli(args)
|
24
|
+
out.should include 'Domain name has to be provided'
|
25
|
+
end
|
26
|
+
|
27
|
+
it "Outputs 'Email has to be provided' if none specified" do
|
28
|
+
args = [
|
29
|
+
'domain',
|
30
|
+
'add_user',
|
31
|
+
TEST_DOMAIN
|
32
|
+
]
|
33
|
+
|
34
|
+
out = run_cli(args)
|
35
|
+
out.should include 'Email has to be provided'
|
36
|
+
end
|
37
|
+
|
38
|
+
it "Outputs 'Password has to be provided' if none specified" do
|
39
|
+
args = [
|
40
|
+
'domain',
|
41
|
+
'add_user',
|
42
|
+
TEST_DOMAIN,
|
43
|
+
TEST_EMAIL
|
44
|
+
]
|
45
|
+
|
46
|
+
out = run_cli(args)
|
47
|
+
out.should include 'Password has to be provided'
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'Works' do
|
51
|
+
args = [
|
52
|
+
'domain',
|
53
|
+
'add_user',
|
54
|
+
TEST_DOMAIN,
|
55
|
+
TEST_EMAIL,
|
56
|
+
TEST_PASSWORD
|
57
|
+
]
|
58
|
+
|
59
|
+
out = run_cli(args)
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
describe 'domain list_users' do
|
65
|
+
it 'Complains when no parameters specified' do
|
66
|
+
args = %w(domain list_users)
|
67
|
+
|
68
|
+
out = run_cli(args)
|
69
|
+
out.should include 'Domain name has to be provided'
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'Works' do
|
73
|
+
args = [
|
74
|
+
'domain',
|
75
|
+
'list_users',
|
76
|
+
'gooddata'
|
77
|
+
]
|
78
|
+
|
79
|
+
out = run_cli(args)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -1,27 +1,43 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
1
3
|
require 'gooddata/cli/cli'
|
2
4
|
|
3
|
-
describe GoodData::CLI do
|
4
|
-
|
5
|
-
|
5
|
+
describe 'GoodData::CLI - process' do
|
6
|
+
describe 'process' do
|
7
|
+
it 'Complains when no subcommand specified' do
|
8
|
+
args = %w(process)
|
6
9
|
|
7
|
-
|
10
|
+
out = run_cli(args)
|
11
|
+
out.should include "Command 'process' requires a subcommand list,show,deploy,delete,execute"
|
12
|
+
end
|
8
13
|
end
|
9
14
|
|
10
|
-
|
11
|
-
|
15
|
+
describe 'process deploy' do
|
16
|
+
it 'Can be called without arguments' do
|
17
|
+
args = %w(process deploy)
|
12
18
|
|
13
|
-
|
19
|
+
run_cli(args)
|
20
|
+
end
|
14
21
|
end
|
15
22
|
|
16
|
-
|
17
|
-
|
23
|
+
describe 'process get' do
|
24
|
+
it 'Can be called without arguments' do
|
25
|
+
args = %w(process get)
|
18
26
|
|
19
|
-
|
27
|
+
run_cli(args)
|
28
|
+
end
|
20
29
|
end
|
21
30
|
|
22
|
-
|
23
|
-
|
31
|
+
describe 'process list' do
|
32
|
+
it 'Lists processes when project ID specified' do
|
33
|
+
args = [
|
34
|
+
'process',
|
35
|
+
'list',
|
36
|
+
ProjectHelper::PROJECT_ID
|
37
|
+
]
|
24
38
|
|
25
|
-
|
39
|
+
run_cli(args)
|
40
|
+
end
|
26
41
|
end
|
42
|
+
|
27
43
|
end
|
@@ -1,60 +1,81 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
1
3
|
require 'gooddata/cli/cli'
|
2
4
|
|
3
|
-
describe GoodData::CLI do
|
4
|
-
|
5
|
-
|
5
|
+
describe 'GoodData::CLI - project' do
|
6
|
+
describe 'project' do
|
7
|
+
it 'Complains when no subcommand specified' do
|
8
|
+
args = %w(project)
|
6
9
|
|
7
|
-
|
10
|
+
out = run_cli(args)
|
11
|
+
out.should include "Command 'project' requires a subcommand jack_in,create,delete,clone,invite,users,show,build,update,roles,validate"
|
12
|
+
end
|
8
13
|
end
|
9
14
|
|
10
|
-
|
11
|
-
|
15
|
+
describe 'project build' do
|
16
|
+
it 'Can be called without arguments' do
|
17
|
+
args = %w(project build)
|
12
18
|
|
13
|
-
|
19
|
+
run_cli(args)
|
20
|
+
end
|
14
21
|
end
|
15
22
|
|
16
|
-
|
17
|
-
|
23
|
+
describe 'project clone' do
|
24
|
+
it 'Can be called without arguments' do
|
25
|
+
args = %w(project clone)
|
18
26
|
|
19
|
-
|
27
|
+
run_cli(args)
|
28
|
+
end
|
20
29
|
end
|
21
30
|
|
22
|
-
|
23
|
-
|
31
|
+
describe 'project create' do
|
32
|
+
it 'Can be called without arguments' do
|
33
|
+
args = %w(project create)
|
24
34
|
|
25
|
-
|
26
|
-
|
27
|
-
|
35
|
+
# TODO: Pass all required args to prevent interaction
|
36
|
+
# TODO: Investigate, fix and enable execution
|
37
|
+
# run_cli(args)
|
38
|
+
end
|
28
39
|
end
|
29
40
|
|
30
|
-
|
31
|
-
|
41
|
+
describe 'project delete' do
|
42
|
+
it 'Can be called without arguments' do
|
43
|
+
args = %w(project delete)
|
32
44
|
|
33
|
-
|
45
|
+
run_cli(args)
|
46
|
+
end
|
34
47
|
end
|
35
48
|
|
36
|
-
|
37
|
-
|
49
|
+
describe 'project jack_in' do
|
50
|
+
it 'Can be called without arguments' do
|
51
|
+
args = %w(project jack_in)
|
38
52
|
|
39
|
-
|
53
|
+
run_cli(args)
|
54
|
+
end
|
40
55
|
end
|
41
56
|
|
42
|
-
|
43
|
-
|
57
|
+
describe 'project list' do
|
58
|
+
it 'Can be called without arguments' do
|
59
|
+
args = %w(project list)
|
44
60
|
|
45
|
-
|
61
|
+
run_cli(args)
|
62
|
+
end
|
46
63
|
end
|
47
64
|
|
48
|
-
|
49
|
-
|
65
|
+
describe 'project show' do
|
66
|
+
it 'Can be called without arguments' do
|
67
|
+
args = %w(project show)
|
50
68
|
|
51
|
-
|
69
|
+
run_cli(args)
|
70
|
+
end
|
52
71
|
end
|
53
72
|
|
54
|
-
|
55
|
-
|
73
|
+
describe 'project update' do
|
74
|
+
it 'Can be called without arguments' do
|
75
|
+
args = %w(project update)
|
56
76
|
|
57
|
-
|
77
|
+
run_cli(args)
|
78
|
+
end
|
58
79
|
end
|
59
80
|
|
60
81
|
end
|