Skip to content

Commit

Permalink
Change rspec generated expectations to match minitest
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed May 23, 2018
1 parent 7db447a commit b2e7958
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
4 changes: 3 additions & 1 deletion lib/tty/templates/add/spec/integration/command_spec.rb.tt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RSpec.describe "`<%= "#{app_name_underscored} #{cmd_name_underscored}" %>` command", type: :cli do
it "executes `<%= "#{app_name_underscored} help #{cmd_name_underscored}" %>` command successfully" do
output = `<%= "#{app_name_underscored} help #{cmd_name_underscored}" %>`
expect(output).to eq <<-OUT
expected_output = <<-OUT
<%- if subcmd_name_underscored.to_s.empty? -%>
Usage:
<%= app_name_underscored + ' ' + cmd_name_underscored + cmd_desc_args %>
Expand All @@ -14,5 +14,7 @@ Options:
Commands:
<%- end -%>
OUT

expect(output).to eq(expected_output)
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RSpec.describe "`<%= "#{app_name_underscored} #{cmd_name_underscored} #{subcmd_name_underscored}" %>` command", type: :cli do
it "executes `<%= "#{app_name_underscored} #{cmd_name_underscored} help #{subcmd_name_underscored}" %>` command successfully" do
output = `<%= "#{app_name_underscored} #{cmd_name_underscored} help #{subcmd_name_underscored}" %>`
expect(output).to eq <<-OUT
expected_output = <<-OUT
Usage:
<%= app_name_underscored + ' ' + subcmd_name_underscored + cmd_desc_args %>

Expand All @@ -10,5 +10,7 @@ Options:

<%= cmd_desc %>
OUT

expect(output).to eq(expected_output)
end
end
4 changes: 3 additions & 1 deletion spec/integration/add_desc_args_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def execute(input: $stdin, output: $stdout)
RSpec.describe "`newcli config` command", type: :cli do
it "executes `newcli help config` command successfully" do
output = `newcli help config`
expect(output).to eq <<-OUT
expected_output = <<-OUT
Usage:
newcli config ARG1 ARG2
Expand All @@ -93,6 +93,8 @@ def execute(input: $stdin, output: $stdout)
Set and get configuration option
OUT
expect(output).to eq(expected_output)
end
end
EOS
Expand Down
12 changes: 9 additions & 3 deletions spec/integration/add_namespaced_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def server(*)
RSpec.describe "`cli-app server` command", type: :cli do
it "executes `cli-app help server` command successfully" do
output = `cli-app help server`
expect(output).to eq <<-OUT
expected_output = <<-OUT
Usage:
cli-app server
Expand All @@ -100,6 +100,8 @@ def server(*)
Command description...
OUT
expect(output).to eq(expected_output)
end
end
EOS
Expand Down Expand Up @@ -241,9 +243,11 @@ def execute(input: $stdin, output: $stdout)
RSpec.describe "`cli-app config` command", type: :cli do
it "executes `cli-app help config` command successfully" do
output = `cli-app help config`
expect(output).to eq <<-OUT
expected_output = <<-OUT
Commands:
OUT
expect(output).to eq(expected_output)
end
end
EOS
Expand All @@ -252,7 +256,7 @@ def execute(input: $stdin, output: $stdout)
RSpec.describe "`cli-app config set` command", type: :cli do
it "executes `cli-app config help set` command successfully" do
output = `cli-app config help set`
expect(output).to eq <<-OUT
expected_output = <<-OUT
Usage:
cli-app set
Expand All @@ -261,6 +265,8 @@ def execute(input: $stdin, output: $stdout)
Command description...
OUT
expect(output).to eq(expected_output)
end
end
EOS
Expand Down
4 changes: 3 additions & 1 deletion spec/integration/add_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def server(*)
RSpec.describe "`newcli server` command", type: :cli do
it "executes `newcli help server` command successfully" do
output = `newcli help server`
expect(output).to eq <<-OUT
expected_output = <<-OUT
Usage:
newcli server
Expand All @@ -94,6 +94,8 @@ def server(*)
Command description...
OUT
expect(output).to eq(expected_output)
end
end
EOS
Expand Down
8 changes: 6 additions & 2 deletions spec/integration/add_subcommand_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ def execute(input: $stdin, output: $stdout)
RSpec.describe "`newcli config` command", type: :cli do
it "executes `newcli help config` command successfully" do
output = `newcli help config`
expect(output).to eq <<-OUT
expected_output = <<-OUT
Commands:
OUT
expect(output).to eq(expected_output)
end
end
EOS
Expand All @@ -121,7 +123,7 @@ def execute(input: $stdin, output: $stdout)
RSpec.describe "`newcli config set` command", type: :cli do
it "executes `newcli config help set` command successfully" do
output = `newcli config help set`
expect(output).to eq <<-OUT
expected_output = <<-OUT
Usage:
newcli set
Expand All @@ -130,6 +132,8 @@ def execute(input: $stdin, output: $stdout)
Command description...
OUT
expect(output).to eq(expected_output)
end
end
EOS
Expand Down

0 comments on commit b2e7958

Please sign in to comment.