-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add dbconsole command #94
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#! /bin/sh | ||
|
||
echo 'Running psql (or some other db repl)' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
RSpec.describe command('cd spec/dummy/rails && nibtest dbconsole web') do | ||
its(:stdout) { should match(/psql/) } | ||
its(:exit_status) { should eq 0 } | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
RSpec.describe 'dbconsole' do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know that this particular unit spec is necessary - it's essentially the same as unit/run_spec.rb There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would tend to agree at this stage @blankenshipz. When originally implementing this feature we had added a Upon further review though we believe we'll need to break this back out into it's own class. The reason being is the shell is doing some very strange things with quoted strings passed to |
||
let(:service) { 'web' } | ||
let(:command) { './bin/dbconsole -c \'SELECT * FROM foo;\'' } | ||
|
||
subject { Nib::Run.new(service, command) } | ||
|
||
it 'executes ./bin/dbconsole' do | ||
expect(subject.script).to match( | ||
%r{ | ||
docker-compose | ||
.* | ||
run | ||
.* | ||
--rm | ||
.* | ||
#{service} | ||
.* | ||
\./bin/dbconsole\s-c\s'SELECT\s\*\sFROM\sfoo;' | ||
}x | ||
) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
someting
->something