summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/fixtures/expected/rust/cargo/v1.0.json105
-rw-r--r--spec/fixtures/expected/rust/cargo/v1.1.json176
-rw-r--r--spec/fixtures/expected/rust/cargo/v2.0.json109
-rw-r--r--spec/fixtures/expected/rust/cargo/v2.1.json92
-rw-r--r--spec/integration/rust/cargo_spec.rb2
5 files changed, 484 insertions, 0 deletions
diff --git a/spec/fixtures/expected/rust/cargo/v1.0.json b/spec/fixtures/expected/rust/cargo/v1.0.json
new file mode 100644
index 0000000..330e5f8
--- /dev/null
+++ b/spec/fixtures/expected/rust/cargo/v1.0.json
@@ -0,0 +1,105 @@
+{
+ "licenses": [
+ {
+ "count": 6,
+ "name": "MIT, Apache 2.0"
+ },
+ {
+ "count": 1,
+ "name": "Unlicense, MIT"
+ }
+ ],
+ "dependencies": [
+ {
+ "license": {
+ "name": "Unlicense, MIT",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "byteorder",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ },
+ {
+ "license": {
+ "name": "MIT, Apache 2.0",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "diesel",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ },
+ {
+ "license": {
+ "name": "MIT, Apache 2.0",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "diesel_derives",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ },
+ {
+ "license": {
+ "name": "MIT, Apache 2.0",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "proc-macro2",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ },
+ {
+ "license": {
+ "name": "MIT, Apache 2.0",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "quote",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ },
+ {
+ "license": {
+ "name": "MIT, Apache 2.0",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "syn",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ },
+ {
+ "license": {
+ "name": "MIT, Apache 2.0",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "unicode-xid",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ }
+ ]
+} \ No newline at end of file
diff --git a/spec/fixtures/expected/rust/cargo/v1.1.json b/spec/fixtures/expected/rust/cargo/v1.1.json
new file mode 100644
index 0000000..2bf5061
--- /dev/null
+++ b/spec/fixtures/expected/rust/cargo/v1.1.json
@@ -0,0 +1,176 @@
+{
+ "version": "1.1",
+ "licenses": [
+ {
+ "count": 6,
+ "name": "MIT, Apache 2.0"
+ },
+ {
+ "count": 1,
+ "name": "Unlicense, MIT"
+ }
+ ],
+ "dependencies": [
+ {
+ "licenses": [
+ {
+ "name": "MIT",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ {
+ "name": "Unlicense",
+ "url": ""
+ }
+ ],
+ "license": {
+ "name": "Unlicense, MIT",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "byteorder",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ },
+ {
+ "licenses": [
+ {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.txt"
+ },
+ {
+ "name": "MIT",
+ "url": "http://opensource.org/licenses/mit-license"
+ }
+ ],
+ "license": {
+ "name": "MIT, Apache 2.0",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "diesel",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ },
+ {
+ "licenses": [
+ {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.txt"
+ },
+ {
+ "name": "MIT",
+ "url": "http://opensource.org/licenses/mit-license"
+ }
+ ],
+ "license": {
+ "name": "MIT, Apache 2.0",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "diesel_derives",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ },
+ {
+ "licenses": [
+ {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.txt"
+ },
+ {
+ "name": "MIT",
+ "url": "http://opensource.org/licenses/mit-license"
+ }
+ ],
+ "license": {
+ "name": "MIT, Apache 2.0",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "proc-macro2",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ },
+ {
+ "licenses": [
+ {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.txt"
+ },
+ {
+ "name": "MIT",
+ "url": "http://opensource.org/licenses/mit-license"
+ }
+ ],
+ "license": {
+ "name": "MIT, Apache 2.0",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "quote",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ },
+ {
+ "licenses": [
+ {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.txt"
+ },
+ {
+ "name": "MIT",
+ "url": "http://opensource.org/licenses/mit-license"
+ }
+ ],
+ "license": {
+ "name": "MIT, Apache 2.0",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "syn",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ },
+ {
+ "licenses": [
+ {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.txt"
+ },
+ {
+ "name": "MIT",
+ "url": "http://opensource.org/licenses/mit-license"
+ }
+ ],
+ "license": {
+ "name": "MIT, Apache 2.0",
+ "url": "http://opensource.org/licenses/mit-license"
+ },
+ "dependency": {
+ "name": "unicode-xid",
+ "description": "",
+ "pathes": [
+ "."
+ ]
+ }
+ }
+ ]
+} \ No newline at end of file
diff --git a/spec/fixtures/expected/rust/cargo/v2.0.json b/spec/fixtures/expected/rust/cargo/v2.0.json
new file mode 100644
index 0000000..2825af5
--- /dev/null
+++ b/spec/fixtures/expected/rust/cargo/v2.0.json
@@ -0,0 +1,109 @@
+{
+ "version": "2.0",
+ "licenses": [
+ {
+ "id": "MIT",
+ "name": "MIT License",
+ "url": "https://opensource.org/licenses/MIT",
+ "count": 7
+ },
+ {
+ "id": "Apache-2.0",
+ "name": "Apache License 2.0",
+ "url": "https://opensource.org/licenses/Apache-2.0",
+ "count": 6
+ },
+ {
+ "id": "Unlicense",
+ "name": "The Unlicense",
+ "url": "https://unlicense.org/",
+ "count": 1
+ }
+ ],
+ "dependencies": [
+ {
+ "name": "byteorder",
+ "url": "",
+ "description": "",
+ "paths": [
+ "."
+ ],
+ "licenses": [
+ "MIT",
+ "Unlicense"
+ ]
+ },
+ {
+ "name": "diesel",
+ "url": "",
+ "description": "",
+ "paths": [
+ "."
+ ],
+ "licenses": [
+ "Apache-2.0",
+ "MIT"
+ ]
+ },
+ {
+ "name": "diesel_derives",
+ "url": "",
+ "description": "",
+ "paths": [
+ "."
+ ],
+ "licenses": [
+ "Apache-2.0",
+ "MIT"
+ ]
+ },
+ {
+ "name": "proc-macro2",
+ "url": "",
+ "description": "",
+ "paths": [
+ "."
+ ],
+ "licenses": [
+ "Apache-2.0",
+ "MIT"
+ ]
+ },
+ {
+ "name": "quote",
+ "url": "",
+ "description": "",
+ "paths": [
+ "."
+ ],
+ "licenses": [
+ "Apache-2.0",
+ "MIT"
+ ]
+ },
+ {
+ "name": "syn",
+ "url": "",
+ "description": "",
+ "paths": [
+ "."
+ ],
+ "licenses": [
+ "Apache-2.0",
+ "MIT"
+ ]
+ },
+ {
+ "name": "unicode-xid",
+ "url": "",
+ "description": "",
+ "paths": [
+ "."
+ ],
+ "licenses": [
+ "Apache-2.0",
+ "MIT"
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/spec/fixtures/expected/rust/cargo/v2.1.json b/spec/fixtures/expected/rust/cargo/v2.1.json
new file mode 100644
index 0000000..5c699ae
--- /dev/null
+++ b/spec/fixtures/expected/rust/cargo/v2.1.json
@@ -0,0 +1,92 @@
+{
+ "version": "2.1",
+ "licenses": [
+ {
+ "id": "Apache-2.0",
+ "name": "Apache License 2.0",
+ "url": "https://opensource.org/licenses/Apache-2.0"
+ },
+ {
+ "id": "MIT",
+ "name": "MIT License",
+ "url": "https://opensource.org/licenses/MIT"
+ },
+ {
+ "id": "Unlicense",
+ "name": "The Unlicense",
+ "url": "https://unlicense.org/"
+ }
+ ],
+ "dependencies": [
+ {
+ "name": "byteorder",
+ "version": "v1.3.4",
+ "package_manager": "cargo",
+ "path": "Cargo.lock",
+ "licenses": [
+ "MIT",
+ "Unlicense"
+ ]
+ },
+ {
+ "name": "diesel",
+ "version": "v1.4.5",
+ "package_manager": "cargo",
+ "path": "Cargo.lock",
+ "licenses": [
+ "Apache-2.0",
+ "MIT"
+ ]
+ },
+ {
+ "name": "diesel_derives",
+ "version": "v1.4.1",
+ "package_manager": "cargo",
+ "path": "Cargo.lock",
+ "licenses": [
+ "Apache-2.0",
+ "MIT"
+ ]
+ },
+ {
+ "name": "proc-macro2",
+ "version": "v1.0.19",
+ "package_manager": "cargo",
+ "path": "Cargo.lock",
+ "licenses": [
+ "Apache-2.0",
+ "MIT"
+ ]
+ },
+ {
+ "name": "quote",
+ "version": "v1.0.7",
+ "package_manager": "cargo",
+ "path": "Cargo.lock",
+ "licenses": [
+ "Apache-2.0",
+ "MIT"
+ ]
+ },
+ {
+ "name": "syn",
+ "version": "v1.0.38",
+ "package_manager": "cargo",
+ "path": "Cargo.lock",
+ "licenses": [
+ "Apache-2.0",
+ "MIT"
+ ]
+ },
+ {
+ "name": "unicode-xid",
+ "version": "v0.2.1",
+ "package_manager": "cargo",
+ "path": "Cargo.lock",
+ "licenses": [
+ "Apache-2.0",
+ "MIT"
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/spec/integration/rust/cargo_spec.rb b/spec/integration/rust/cargo_spec.rb
index 7b2b606..c4ee6fa 100644
--- a/spec/integration/rust/cargo_spec.rb
+++ b/spec/integration/rust/cargo_spec.rb
@@ -12,6 +12,8 @@ RSpec.describe "cargo" do
system("rm -r #{install_dir}") if Dir.exist?(install_dir)
end
+ include_examples "each report version", "rust", "cargo"
+
context "when scanning a cargo project" do
before do
runner.mount(dir: fixture_file('rust/cargo/hello_world'))