Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions spec/cb/backup_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,26 @@ private class BackupTestClient < CB::Client
end

private def make_ba
CB::BackupCapture.new(BackupTestClient.new(TEST_TOKEN))
CB::Action::BackupCapture.new(BackupTestClient.new(TEST_TOKEN))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that might be worth trying, is if we include CB::Action once at the top of a spec, then I think everywhere in that file we can just have BackupCapture. It might cut down on a lot of the extra scoping and be okay enough for a given file at a time?

end

private def make_bl
CB::BackupList.new(BackupTestClient.new(TEST_TOKEN))
CB::Action::BackupList.new(BackupTestClient.new(TEST_TOKEN))
end

private def make_bt
CB::BackupToken.new(BackupTestClient.new(TEST_TOKEN))
CB::Action::BackupToken.new(BackupTestClient.new(TEST_TOKEN))
end

describe CB::BackupCapture do
describe CB::Action::BackupCapture do
it "validates that cluster_id is correct" do
ba = make_ba
ba.cluster_id = "afpvoqooxzdrriu6w3bhqo55c4"
expect_cb_error(/cluster id/) { ba.cluster_id = "notaneid" }
end
end

describe CB::BackupList do
describe CB::Action::BackupList do
it "validates that cluster_id is correct" do
bl = make_bl
bl.cluster_id = "afpvoqooxzdrriu6w3bhqo55c4"
Expand All @@ -87,7 +87,7 @@ describe CB::BackupList do
end
end

describe CB::BackupToken do
describe CB::Action::BackupToken do
it "validates that cluster_id is correct" do
bt = make_bt
bt.cluster_id = "afpvoqooxzdrriu6w3bhqo55c4"
Expand Down
4 changes: 2 additions & 2 deletions spec/cb/cluster_create_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ private class ClusterCreateTestClient < CB::Client
end

private def make_cc
CB::ClusterCreate.new(ClusterCreateTestClient.new(TEST_TOKEN))
CB::Action::ClusterCreate.new(ClusterCreateTestClient.new(TEST_TOKEN))
end

describe CB::ClusterCreate do
describe CB::Action::ClusterCreate do
it "#run prints info about the cluster that was created" do
cc = make_cc
cc.output = output = IO::Memory.new
Expand Down
18 changes: 9 additions & 9 deletions spec/cb/cluster_upgrade_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ private class ClusterUpgradeTestClient < CB::Client
end
end

describe CB::UpgradeStart do
describe CB::Action::UpgradeStart do
it "validates that required arguments are present" do
action = CB::UpgradeStart.new(ClusterUpgradeTestClient.new(TEST_TOKEN))
action = CB::Action::UpgradeStart.new(ClusterUpgradeTestClient.new(TEST_TOKEN))

msg = /Missing required argument/

Expand All @@ -63,7 +63,7 @@ describe CB::UpgradeStart do
end

it "#run prints cluster upgrade started" do
action = CB::UpgradeStart.new(ClusterUpgradeTestClient.new(TEST_TOKEN))
action = CB::Action::UpgradeStart.new(ClusterUpgradeTestClient.new(TEST_TOKEN))
action.output = output = IO::Memory.new

action.cluster_id = "pkdpq6yynjgjbps4otxd7il2u4"
Expand All @@ -75,9 +75,9 @@ describe CB::UpgradeStart do
end
end

describe CB::UpgradeStatus do
describe CB::Action::UpgradeStatus do
it "validates that required arguments are present" do
action = CB::UpgradeStatus.new(ClusterUpgradeTestClient.new(TEST_TOKEN))
action = CB::Action::UpgradeStatus.new(ClusterUpgradeTestClient.new(TEST_TOKEN))

msg = /Missing required argument/

Expand All @@ -87,7 +87,7 @@ describe CB::UpgradeStatus do
end

it "#run no upgrades" do
action = CB::UpgradeStatus.new(ClusterUpgradeTestClient.new(TEST_TOKEN))
action = CB::Action::UpgradeStatus.new(ClusterUpgradeTestClient.new(TEST_TOKEN))
action.output = output = IO::Memory.new

action.cluster_id = "pkdpq6yynjgjbps4otxd7il2u4"
Expand All @@ -98,9 +98,9 @@ describe CB::UpgradeStatus do
end
end

describe CB::UpgradeCancel do
describe CB::Action::UpgradeCancel do
it "validates that required arguments are present" do
action = CB::UpgradeCancel.new(ClusterUpgradeTestClient.new(TEST_TOKEN))
action = CB::Action::UpgradeCancel.new(ClusterUpgradeTestClient.new(TEST_TOKEN))

msg = /Missing required argument/

Expand All @@ -110,7 +110,7 @@ describe CB::UpgradeCancel do
end

it "#run " do
action = CB::UpgradeCancel.new(ClusterUpgradeTestClient.new(TEST_TOKEN))
action = CB::Action::UpgradeCancel.new(ClusterUpgradeTestClient.new(TEST_TOKEN))
action.output = output = IO::Memory.new

action.cluster_id = "pkdpq6yynjgjbps4otxd7il2u4"
Expand Down
10 changes: 5 additions & 5 deletions spec/cb/cluster_uri_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ private class ClusterURITestClient < CB::Client
end
end

describe CB::ClusterURI do
describe CB::Action::ClusterURI do
it "ensures 'default' if role not specified" do
action = CB::ClusterURI.new(ClusterURITestClient.new(TEST_TOKEN))
action = CB::Action::ClusterURI.new(ClusterURITestClient.new(TEST_TOKEN))
action.output = IO::Memory.new

action.call
Expand All @@ -34,7 +34,7 @@ describe CB::ClusterURI do
end

it "#run errors on invalid role" do
action = CB::ClusterURI.new(ClusterURITestClient.new(TEST_TOKEN))
action = CB::Action::ClusterURI.new(ClusterURITestClient.new(TEST_TOKEN))
action.output = IO::Memory.new

action.role_name = "invalid"
Expand All @@ -51,7 +51,7 @@ describe CB::ClusterURI do
HTTP::Client::Response.new(HTTP::Status::BAD_REQUEST))
}

action = CB::ClusterURI.new(c)
action = CB::Action::ClusterURI.new(c)
action.output = IO::Memory.new

msg = /invalid input/
Expand All @@ -62,7 +62,7 @@ describe CB::ClusterURI do
it "#run prints uri" do
c = ClusterURITestClient.new(TEST_TOKEN)

action = CB::ClusterURI.new(c)
action = CB::Action::ClusterURI.new(c)
action.output = output = IO::Memory.new

action.call
Expand Down
4 changes: 2 additions & 2 deletions spec/cb/logdest_add_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ private class LogDestinationAddTestClient < CB::Client
end

private def make_lda
CB::LogDestinationAdd.new(LogDestinationAddTestClient.new(TEST_TOKEN))
CB::Action::LogDestinationAdd.new(LogDestinationAddTestClient.new(TEST_TOKEN))
end

private def expect_validation_err(lda, part)
expect_cb_error(/Missing required argument.+#{part}/) { lda.validate }
end

describe CB::LogDestinationAdd do
describe CB::Action::LogDestinationAdd do
it "validates that required arguments are present" do
lda = make_lda

Expand Down
6 changes: 3 additions & 3 deletions spec/cb/restart_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ private class RestartTestClient < CB::Client
end
end

describe CB::Restart do
describe CB::Action::Restart do
it "validates that required arguments are present" do
action = CB::Restart.new(RestartTestClient.new(TEST_TOKEN))
action = CB::Action::Restart.new(RestartTestClient.new(TEST_TOKEN))

msg = /Missing required argument/
expect_cb_error(msg) { action.validate }
Expand All @@ -37,7 +37,7 @@ describe CB::Restart do
end

it "#run prints confirmation" do
action = CB::Restart.new(RestartTestClient.new(TEST_TOKEN))
action = CB::Action::Restart.new(RestartTestClient.new(TEST_TOKEN))
action.output = IO::Memory.new

action.cluster_id = "pkdpq6yynjgjbps4otxd7il2u4"
Expand Down
26 changes: 13 additions & 13 deletions spec/cb/role_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ private class RoleTestClient < CB::Client
end
end

describe CB::RoleCreate do
describe CB::Action::RoleCreate do
it "validates that required arguments are present" do
action = CB::RoleCreate.new(RoleTestClient.new(TEST_TOKEN))
action = CB::Action::RoleCreate.new(RoleTestClient.new(TEST_TOKEN))

msg = /Missing required argument/

Expand All @@ -41,7 +41,7 @@ describe CB::RoleCreate do
end

it "#run prints confirmation" do
action = CB::RoleCreate.new(RoleTestClient.new(TEST_TOKEN))
action = CB::Action::RoleCreate.new(RoleTestClient.new(TEST_TOKEN))
action.output = output = IO::Memory.new

action.cluster_id = "pkdpq6yynjgjbps4otxd7il2u4"
Expand All @@ -52,9 +52,9 @@ describe CB::RoleCreate do
end
end

describe CB::RoleUpdate do
describe CB::Action::RoleUpdate do
it "validates that required arguments are present" do
action = CB::RoleUpdate.new(RoleTestClient.new(TEST_TOKEN))
action = CB::Action::RoleUpdate.new(RoleTestClient.new(TEST_TOKEN))

msg = /Missing required argument/

Expand All @@ -65,7 +65,7 @@ describe CB::RoleUpdate do
end

it "#run errors on invalid role" do
action = CB::RoleUpdate.new(RoleTestClient.new(TEST_TOKEN))
action = CB::Action::RoleUpdate.new(RoleTestClient.new(TEST_TOKEN))
action.output = IO::Memory.new

action.cluster_id = "pkdpq6yynjgjbps4otxd7il2u4"
Expand All @@ -77,7 +77,7 @@ describe CB::RoleUpdate do
end

it "#run translates 'user' role" do
action = CB::RoleUpdate.new(RoleTestClient.new(TEST_TOKEN))
action = CB::Action::RoleUpdate.new(RoleTestClient.new(TEST_TOKEN))
action.output = IO::Memory.new

action.cluster_id = "pkdpq6yynjgjbps4otxd7il2u4"
Expand All @@ -89,7 +89,7 @@ describe CB::RoleUpdate do
end

it "#run prints confirmation" do
action = CB::RoleUpdate.new(RoleTestClient.new(TEST_TOKEN))
action = CB::Action::RoleUpdate.new(RoleTestClient.new(TEST_TOKEN))
action.output = output = IO::Memory.new

action.cluster_id = "pkdpq6yynjgjbps4otxd7il2u4"
Expand All @@ -101,17 +101,17 @@ describe CB::RoleUpdate do
end
end

describe CB::RoleDelete do
describe CB::Action::RoleDelete do
it "validate that required arguments are present" do
action = CB::RoleDelete.new(RoleTestClient.new(TEST_TOKEN))
action = CB::Action::RoleDelete.new(RoleTestClient.new(TEST_TOKEN))
action.output = IO::Memory.new

action.cluster_id = "pkdpq6yynjgjbps4otxd7il2u4"
action.role_name = "user"
end

it "#run errors on invalid role" do
action = CB::RoleDelete.new(RoleTestClient.new(TEST_TOKEN))
action = CB::Action::RoleDelete.new(RoleTestClient.new(TEST_TOKEN))
action.output = IO::Memory.new

action.cluster_id = "pkdpq6yynjgjbps4otxd7il2u4"
Expand All @@ -121,7 +121,7 @@ describe CB::RoleDelete do
end

it "#run translates 'user' role" do
action = CB::RoleDelete.new(RoleTestClient.new(TEST_TOKEN))
action = CB::Action::RoleDelete.new(RoleTestClient.new(TEST_TOKEN))
action.output = IO::Memory.new

action.cluster_id = "pkdpq6yynjgjbps4otxd7il2u4"
Expand All @@ -133,7 +133,7 @@ describe CB::RoleDelete do
end

it "#run prints confirmation" do
action = CB::RoleDelete.new(RoleTestClient.new(TEST_TOKEN))
action = CB::Action::RoleDelete.new(RoleTestClient.new(TEST_TOKEN))
action.output = output = IO::Memory.new

action.cluster_id = "pkdpq6yynjgjbps4otxd7il2u4"
Expand Down
Loading