Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean Up and Dry Tests #344

Merged
merged 7 commits into from
Nov 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 17 additions & 15 deletions spec/amber/cli/commands/encrypt_spec.cr
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
require "../../../spec_helper"
require "../../../support/helpers/cli_helper"

include CLIHelper

module Amber::CLI
begin
describe MainCommand::Encrypt do
context "application structure" do
it "creates amber directory structure" do
MainCommand.run ["new", TESTING_APP]
Dir.exists?(TESTING_APP).should be_true
Dir.cd(TESTING_APP)
MainCommand.run ["encrypt", "test"]
File.exists?("config/environments/.test.enc").should be_true
File.read(".amber_secret_key").size.should eq 44
Amber::CLI::Spec.cleanup
end
end
describe "amber encrypt" do
arg = "test"
cleanup
scaffold_app(TESTING_APP)
MainCommand.run ["encrypt", "test"]

it "creates a hidden .#{arg}.enc file" do
File.exists?("config/environments/.#{arg}.enc").should be_true
end
ensure
Amber::CLI::Spec.cleanup

it "creates a 44 characters secret key in .amber_secret_key" do
File.read(".amber_secret_key").size.should eq 44
end

cleanup
end
end