test/unit/output/adapter/table_test.rb in hammer_cli-3.6.0 vs test/unit/output/adapter/table_test.rb in hammer_cli-3.7.0
- old
+ new
@@ -92,11 +92,11 @@
let(:fields) {
[field_name, field_id]
}
it "should ommit column of type Id by default" do
- out, err = capture_io { adapter.print_collection(fields, data) }
+ out, _ = capture_io { adapter.print_collection(fields, data) }
out.wont_match(/.*ID.*/)
end
it "should ommit column of type Id by default but no data" do
expected_output = [
@@ -108,11 +108,11 @@
proc { adapter.print_collection(fields, empty_data) }.must_output(expected_output)
end
it "should print column of type Id when --show-ids is set" do
adapter = HammerCLI::Output::Adapter::Table.new( { :show_ids => true } )
- out, err = capture_io { adapter.print_collection(fields, data) }
+ out, _ = capture_io { adapter.print_collection(fields, data) }
out.must_match(/.*ID.*/)
end
it "should print column of type ID when --show-ids is set but no data" do
expected_output = [
@@ -126,16 +126,16 @@
end
end
context "handle headers" do
it "should print headers by default" do
- out, err = capture_io { adapter.print_collection(fields, data) }
+ out, _ = capture_io { adapter.print_collection(fields, data) }
out.must_match(/.*NAME.*/)
end
it "should print headers by default even if there is no data" do
- out, err = capture_io { adapter.print_collection(fields, empty_data) }
+ out, _ = capture_io { adapter.print_collection(fields, empty_data) }
out.must_match(/.*NAME.*/)
end
it "should print data only when --no-headers is set" do
expected_output = [
@@ -351,10 +351,10 @@
'-DOT-'
end
end
adapter = HammerCLI::Output::Adapter::Table.new({}, { :Field => [ DotFormatter.new ]})
- out, err = capture_io { adapter.print_collection(fields, data) }
+ out, _ = capture_io { adapter.print_collection(fields, data) }
out.must_match(/.*-DOT-.*/)
end
it "should not break formatting" do
class SliceFormatter < HammerCLI::Output::Formatters::FieldFormatter