Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
awesim-cli
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gateways
awesim-cli
Commits
9174b8c4
Commit
9174b8c4
authored
9 years ago
by
Eric Franz
Browse files
Options
Downloads
Patches
Plain Diff
move unit test to correct file
parent
a0c0e92f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/test_app_manifest.rb
+1
-31
1 addition, 31 deletions
test/test_app_manifest.rb
test/test_manifest.rb
+29
-0
29 additions, 0 deletions
test/test_manifest.rb
with
30 additions
and
31 deletions
test/test_app_manifest.rb
+
1
−
31
View file @
9174b8c4
...
@@ -24,8 +24,7 @@ documentation: |
...
@@ -24,8 +24,7 @@ documentation: |
@tmpdir
=
Pathname
.
new
File
.
realpath
Dir
.
mktmpdir
@tmpdir
=
Pathname
.
new
File
.
realpath
Dir
.
mktmpdir
@app_rx
=
@tmpdir
.
join
(
"app_rx"
)
@app_rx
=
@tmpdir
.
join
(
"app_rx"
)
@app_rx_manifest_path
=
@app_rx
.
join
(
"manifest.yml"
)
add_manifest
(
@app_rx
.
join
(
"manifest.yml"
))
add_manifest
(
@app_rx_manifest_path
)
@app_norx
=
@tmpdir
.
join
(
"app_norx"
)
@app_norx
=
@tmpdir
.
join
(
"app_norx"
)
add_manifest
(
@app_norx
.
join
(
"manifest.yml"
))
add_manifest
(
@app_norx
.
join
(
"manifest.yml"
))
...
@@ -70,35 +69,6 @@ documentation: |
...
@@ -70,35 +69,6 @@ documentation: |
assert
app
.
valid_dir?
,
"app is valid directory name"
assert
app
.
valid_dir?
,
"app is valid directory name"
end
end
def
test_manifest_with_empty_fields_still_loads
yaml
=
%q(---
provider:
name:
description:
documentation:
)
add_manifest
(
@app_rx_manifest_path
,
yaml
)
app
=
AweSim
::
App
.
new
(
workdir:
@app_rx
)
assert
app
.
manifest
.
valid?
assert
app
.
manifest
.
exist?
assert_equal
""
,
app
.
manifest
.
provider
assert_equal
""
,
app
.
manifest
.
name
assert_equal
""
,
app
.
manifest
.
description
assert_equal
""
,
app
.
manifest
.
documentation
manifest
=
AweSim
::
MissingManifest
.
new
({})
assert_equal
""
,
manifest
.
provider
assert_equal
""
,
manifest
.
name
assert_equal
""
,
manifest
.
description
assert_equal
""
,
manifest
.
documentation
manifest
=
AweSim
::
InvalidManifest
.
new
(
nil
)
assert_equal
""
,
manifest
.
provider
assert_equal
""
,
manifest
.
name
assert_equal
""
,
manifest
.
description
assert_equal
""
,
manifest
.
documentation
end
# TODO: cfs.yml, cfs/manifest.yml, and cfs rx: read manifest.yml
# TODO: cfs.yml, cfs/manifest.yml, and cfs rx: read manifest.yml
# TODO: no cfs.yml, cfs/manifest.yml, and cfs no rx: hide app App.invalid
# TODO: no cfs.yml, cfs/manifest.yml, and cfs no rx: hide app App.invalid
...
...
This diff is collapsed.
Click to expand it.
test/test_manifest.rb
+
29
−
0
View file @
9174b8c4
...
@@ -38,6 +38,7 @@ documentation: |
...
@@ -38,6 +38,7 @@ documentation: |
assert
manifest
.
exist?
assert
manifest
.
exist?
end
end
def
test_manifest_handles_good_yaml
def
test_manifest_handles_good_yaml
assert_valid_manifest
AweSim
::
Manifest
.
load_from_string
(
@yaml
)
assert_valid_manifest
AweSim
::
Manifest
.
load_from_string
(
@yaml
)
assert_valid_manifest
AweSim
::
Manifest
.
load
(
@yaml_path
)
assert_valid_manifest
AweSim
::
Manifest
.
load
(
@yaml_path
)
...
@@ -71,5 +72,33 @@ documentation: |
...
@@ -71,5 +72,33 @@ documentation: |
manifest
=
AweSim
::
Manifest
.
load
(
badyaml
)
manifest
=
AweSim
::
Manifest
.
load
(
badyaml
)
assert_invalid_manifest_has_exception
manifest
,
AweSim
::
Manifest
::
InvalidContentError
assert_invalid_manifest_has_exception
manifest
,
AweSim
::
Manifest
::
InvalidContentError
end
end
def
test_manifest_with_empty_fields
yaml
=
%q(---
provider:
name:
description:
documentation:
)
manifest
=
AweSim
::
Manifest
.
load_from_string
(
yaml
)
assert
manifest
.
valid?
assert
manifest
.
exist?
assert_equal
""
,
manifest
.
provider
assert_equal
""
,
manifest
.
name
assert_equal
""
,
manifest
.
description
assert_equal
""
,
manifest
.
documentation
manifest
=
AweSim
::
MissingManifest
.
new
({})
assert_equal
""
,
manifest
.
provider
assert_equal
""
,
manifest
.
name
assert_equal
""
,
manifest
.
description
assert_equal
""
,
manifest
.
documentation
manifest
=
AweSim
::
InvalidManifest
.
new
(
nil
)
assert_equal
""
,
manifest
.
provider
assert_equal
""
,
manifest
.
name
assert_equal
""
,
manifest
.
description
assert_equal
""
,
manifest
.
documentation
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment