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

Make sh an alias for shell #1308

Merged
merged 1 commit into from Jan 31, 2018
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
2 changes: 1 addition & 1 deletion nanoc/lib/nanoc/cli/commands/shell.rb
Expand Up @@ -2,7 +2,7 @@

usage 'shell'
summary 'open a shell on the Nanoc environment'
aliases 'console'
aliases 'console', 'sh'
description "
Open an IRB shell on a context that contains @items, @layouts, and @config.
"
Expand Down
18 changes: 18 additions & 0 deletions nanoc/spec/nanoc/cli/commands/shell_spec.rb
Expand Up @@ -27,6 +27,24 @@
Nanoc::CLI.run(['shell'])
end

it 'can be invoked as sh' do
expect_any_instance_of(Nanoc::Int::Context).to receive(:pry) do |ctx|
expect(ctx.items.size).to eq(1)
expect(ctx.items.to_a[0].unwrap.content.string).to eq('Hello!')
end

Nanoc::CLI.run(['sh'])
end

it 'can be invoked as console' do
expect_any_instance_of(Nanoc::Int::Context).to receive(:pry) do |ctx|
expect(ctx.items.size).to eq(1)
expect(ctx.items.to_a[0].unwrap.content.string).to eq('Hello!')
end

Nanoc::CLI.run(['console'])
end

it 'will preprocess if requested' do
expect_any_instance_of(Nanoc::Int::Context).to receive(:pry) do |ctx|
expect(ctx.items.size).to eq(1)
Expand Down