Skip to content

Commit

Permalink
#706 fix search?
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Nov 29, 2023
1 parent 8f6dfb9 commit 6e3e010
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cli/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
mod test {
use assert_cmd::Command;

const TEST_URL: &str =
"https://atomicdata.dev/agents/QmfpRIBn2JYEatT0MjSkMNoBJzstz19orwnT5oT2rcQ=";

#[test]
fn get_fail() {
let mut cmd = Command::cargo_bin(assert_cmd::crate_name!()).unwrap();
Expand All @@ -19,31 +22,29 @@ mod test {
#[test]
fn get_url() {
let mut cmd = Command::cargo_bin(assert_cmd::crate_name!()).unwrap();
cmd.args(["get", "https://atomicdata.dev/classes"])
.assert()
.success();
cmd.args(["get", TEST_URL]).assert().success();
}

#[test]
fn get_path() {
let mut cmd = Command::cargo_bin(assert_cmd::crate_name!()).unwrap();
cmd.args(["get", "https://atomicdata.dev/classes members"])
cmd.args(["get", &format!("{TEST_URL} name")])
.assert()
.success();
}

#[test]
fn get_path_array() {
let mut cmd = Command::cargo_bin(assert_cmd::crate_name!()).unwrap();
cmd.args(["get", "https://atomicdata.dev/classes is-a 0"])
cmd.args(["get", &format!("{TEST_URL} is-a 0")])
.assert()
.success();
}

#[test]
fn get_path_array_non_existent() {
let mut cmd = Command::cargo_bin(assert_cmd::crate_name!()).unwrap();
cmd.args(["get", "https://atomicdata.dev/classes is-a 1"])
cmd.args(["get", &format!("{TEST_URL} is-a 1")])
.assert()
.failure();
}
Expand Down
16 changes: 16 additions & 0 deletions lib/defaults/default_store.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
[
{
"@id": "https://atomicdata.dev",
"https://atomicdata.dev/properties/classtype": "https://atomicdata.dev/classes/Drive"
},
{
"@id": "https://atomicdata.dev/properties",
"https://atomicdata.dev/properties/parent": "https://atomicdata.dev"
},
{
"@id": "https://atomicdata.dev/classes",
"https://atomicdata.dev/properties/parent": "https://atomicdata.dev"
},
{
"@id": "https://atomicdata.dev/datatypes",
"https://atomicdata.dev/properties/parent": "https://atomicdata.dev"
},
{
"@id": "https://atomicdata.dev/properties/endpoint/parameters",
"https://atomicdata.dev/properties/classtype": "https://atomicdata.dev/classes/Property",
Expand Down

0 comments on commit 6e3e010

Please sign in to comment.