|
14 | 14 | EOS |
15 | 15 | end |
16 | 16 |
|
| 17 | + let(:stdin_with_table_format) do |
| 18 | + <<-EOS |
| 19 | +Fetching gem metadata from https://rubygems.org/.......... |
| 20 | +Resolving dependencies.... |
| 21 | +
|
| 22 | +Gem Current Latest Requested Groups |
| 23 | +faker 1.6.5 1.6.6 ~> 1.4 development, test |
| 24 | +hashie 1.2.0 3.4.6 = 1.2.0 default |
| 25 | +headless 2.2.3 2.3.1 |
| 26 | + EOS |
| 27 | + end |
| 28 | + |
17 | 29 | let(:stdin_without_outdated) do |
18 | 30 | <<-EOS |
19 | 31 | Fetching gem metadata from https://rubygems.org/.......... |
|
430 | 442 | it { expect { command }.to output(help).to_stdout } |
431 | 443 | end |
432 | 444 |
|
| 445 | + before do |
| 446 | + allow_any_instance_of(StringIO).to receive(:ioctl).and_return(-1) |
| 447 | + end |
| 448 | + |
433 | 449 | describe '.start' do |
434 | 450 | subject(:command) { described_class.start(thor_args) } |
435 | 451 |
|
|
453 | 469 |
|
454 | 470 | it_behaves_like 'terminal format' |
455 | 471 |
|
| 472 | + context 'with table format' do |
| 473 | + let(:stdin) { stdin_with_table_format } |
| 474 | + |
| 475 | + it_behaves_like 'terminal format' |
| 476 | + end |
| 477 | + |
456 | 478 | context 'without outdated' do |
457 | 479 | let(:stdin) { stdin_without_outdated } |
458 | 480 | let(:stdout_terminal_unicode) { stdout_terminal_unicode_without_outdated } |
|
504 | 526 |
|
505 | 527 | it_behaves_like 'terminal format', style: :ascii |
506 | 528 |
|
| 529 | + context 'with table format' do |
| 530 | + let(:stdin) { stdin_with_table_format } |
| 531 | + |
| 532 | + it_behaves_like 'terminal format', style: :ascii |
| 533 | + end |
| 534 | + |
507 | 535 | context 'without outdated' do |
508 | 536 | let(:stdin) { stdin_without_outdated } |
509 | 537 | let(:stdout_terminal_ascii) { stdout_terminal_ascii_without_outdated } |
|
535 | 563 |
|
536 | 564 | it_behaves_like 'markdown format' |
537 | 565 |
|
| 566 | + context 'with table format' do |
| 567 | + let(:stdin) { stdin_with_table_format } |
| 568 | + |
| 569 | + it_behaves_like 'markdown format' |
| 570 | + end |
| 571 | + |
538 | 572 | context 'without outdated' do |
539 | 573 | let(:stdin) { stdin_without_outdated } |
540 | 574 | let(:stdout_markdown) { stdout_markdown_without_outdated } |
|
610 | 644 |
|
611 | 645 | it_behaves_like 'json format' |
612 | 646 |
|
| 647 | + context 'with table format' do |
| 648 | + let(:stdin) { stdin_with_table_format } |
| 649 | + |
| 650 | + it_behaves_like 'json format' |
| 651 | + end |
| 652 | + |
613 | 653 | context 'without outdated' do |
614 | 654 | let(:stdin) { stdin_without_outdated } |
615 | 655 | let(:stdout_json) { stdout_json_without_outdated } |
|
637 | 677 |
|
638 | 678 | it_behaves_like 'json format', pretty: true |
639 | 679 |
|
| 680 | + context 'with table format' do |
| 681 | + let(:stdin) { stdin_with_table_format } |
| 682 | + |
| 683 | + it_behaves_like 'json format', pretty: true |
| 684 | + end |
| 685 | + |
640 | 686 | context 'without outdated' do |
641 | 687 | let(:stdin) { stdin_without_outdated } |
642 | 688 | let(:stdout_json_pretty) { stdout_json_pretty_without_outdated } |
|
692 | 738 |
|
693 | 739 | it_behaves_like 'yaml format' |
694 | 740 |
|
| 741 | + context 'with table format' do |
| 742 | + let(:stdin) { stdin_with_table_format } |
| 743 | + |
| 744 | + it_behaves_like 'yaml format' |
| 745 | + end |
| 746 | + |
695 | 747 | context 'without outdated' do |
696 | 748 | let(:stdin) { stdin_without_outdated } |
697 | 749 | let(:stdout_yaml) { stdout_yaml_without_outdated } |
|
767 | 819 |
|
768 | 820 | it_behaves_like 'csv format' |
769 | 821 |
|
| 822 | + context 'with table format' do |
| 823 | + let(:stdin) { stdin_with_table_format } |
| 824 | + |
| 825 | + it_behaves_like 'csv format' |
| 826 | + end |
| 827 | + |
770 | 828 | context 'without outdated' do |
771 | 829 | let(:stdin) { stdin_without_outdated } |
772 | 830 | let(:stdout_csv) { stdout_csv_without_outdated } |
|
842 | 900 |
|
843 | 901 | it_behaves_like 'tsv format' |
844 | 902 |
|
| 903 | + context 'with table format' do |
| 904 | + let(:stdin) { stdin_with_table_format } |
| 905 | + |
| 906 | + it_behaves_like 'tsv format' |
| 907 | + end |
| 908 | + |
845 | 909 | context 'without outdated' do |
846 | 910 | let(:stdin) { stdin_without_outdated } |
847 | 911 | let(:stdout_tsv) { stdout_tsv_without_outdated } |
|
917 | 981 |
|
918 | 982 | it_behaves_like 'xml format' |
919 | 983 |
|
| 984 | + context 'with table format' do |
| 985 | + let(:stdin) { stdin_with_table_format } |
| 986 | + |
| 987 | + it_behaves_like 'xml format' |
| 988 | + end |
| 989 | + |
920 | 990 | context 'without outdated' do |
921 | 991 | let(:stdin) { stdin_without_outdated } |
922 | 992 | let(:stdout_xml) { stdout_xml_without_outdated } |
|
944 | 1014 |
|
945 | 1015 | it_behaves_like 'xml format', pretty: true |
946 | 1016 |
|
| 1017 | + context 'with table format' do |
| 1018 | + let(:stdin) { stdin_with_table_format } |
| 1019 | + |
| 1020 | + it_behaves_like 'xml format', pretty: true |
| 1021 | + end |
| 1022 | + |
947 | 1023 | context 'without outdated' do |
948 | 1024 | let(:stdin) { stdin_without_outdated } |
949 | 1025 | let(:stdout_xml_pretty) { stdout_xml_pretty_without_outdated } |
|
999 | 1075 |
|
1000 | 1076 | it_behaves_like 'html format' |
1001 | 1077 |
|
| 1078 | + context 'with table format' do |
| 1079 | + let(:stdin) { stdin_with_table_format } |
| 1080 | + |
| 1081 | + it_behaves_like 'html format' |
| 1082 | + end |
| 1083 | + |
1002 | 1084 | context 'without outdated' do |
1003 | 1085 | let(:stdin) { stdin_without_outdated } |
1004 | 1086 | let(:stdout_html) { stdout_html_without_outdated } |
|
1026 | 1108 |
|
1027 | 1109 | it_behaves_like 'html format', pretty: true |
1028 | 1110 |
|
| 1111 | + context 'with table format' do |
| 1112 | + let(:stdin) { stdin_with_table_format } |
| 1113 | + |
| 1114 | + it_behaves_like 'html format', pretty: true |
| 1115 | + end |
| 1116 | + |
1029 | 1117 | context 'without outdated' do |
1030 | 1118 | let(:stdin) { stdin_without_outdated } |
1031 | 1119 | let(:stdout_html_pretty) { stdout_html_pretty_without_outdated } |
|
0 commit comments