Skip to content
Snippets Groups Projects
Commit 9174b8c4 authored by Eric Franz's avatar Eric Franz
Browse files

move unit test to correct file

parent a0c0e92f
No related branches found
No related tags found
No related merge requests found
...@@ -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
......
...@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment