File tree Expand file tree Collapse file tree 6 files changed +94
-3
lines changed
Expand file tree Collapse file tree 6 files changed +94
-3
lines changed Original file line number Diff line number Diff line change 2222 ruby-version : ' ${{ matrix.ruby }}'
2323 bundler-cache : true
2424
25+ - name : Install zsh
26+ run : sudo apt install -y zsh
27+
2528 - name : Run tests
2629 run : bundle exec rspec
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2+ if [[ -n $ZSH_VERSION ]]; then
3+ autoload -U +X bashcompinit && bashcompinit
4+ autoload -U +X compinit && compinit
5+ fi
6+
7+ # === COMPLETION SCRIPT START ===
8+
29< %= script || %Q[source " #{absolute_script_path}" ] %>
310
4- # END OF COMPLETION SCRIPT
11+ # === COMPLETION SCRIPT END ===
512
613COMP_WORDS=( < %= compline %> )
714COMP_LINE=" <%= compline %>"
Original file line number Diff line number Diff line change 1+ # Completely Specs
2+
3+ ## Running tests
4+
5+ ``` bash
6+ $ rspec
7+ # or
8+ $ run spec
9+ # or, to run just tests in a given file
10+ $ run spec zsh
11+ # or, to run just specs tagged with :focus
12+ $ run spec :focus
13+ ```
14+
15+ You might need to prefix the commands with ` bundle exec ` , depending on the way
16+ Ruby is installed.
17+
18+ ## Interactive Approvals
19+
20+ Some tests may prompt you for an interactive approval of changes. This
21+ functionality is provided by the [ rspec_approvals gem] [ 1 ] .
22+
23+ Be sure to only approve changes that are indeed expected.
24+
25+
26+ ## ZSH Compatibility Test
27+
28+ ZSH compatibility test is done by running the completely tester script inside a
29+ zsh container. This is all done automatically by ` spec/completely/zsh_spec.rb ` .
30+
31+
32+ [ 1 ] : https://github.com/dannyben/rspec_approvals
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2+ if [[ -n $ZSH_VERSION ]]; then
3+ autoload -U +X bashcompinit && bashcompinit
4+ autoload -U +X compinit && compinit
5+ fi
6+
7+ # === COMPLETION SCRIPT START ===
8+
29# some completion script
310
4- # END OF COMPLETION SCRIPT
11+ # === COMPLETION SCRIPT END ===
512
613COMP_WORDS=( cli co )
714COMP_LINE=" cli co"
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2+ if [[ -n $ZSH_VERSION ]]; then
3+ autoload -U +X bashcompinit && bashcompinit
4+ autoload -U +X compinit && compinit
5+ fi
6+
7+ # === COMPLETION SCRIPT START ===
8+
29source " <path removed>"
310
4- # END OF COMPLETION SCRIPT
11+ # === COMPLETION SCRIPT END ===
512
613COMP_WORDS=( cli co )
714COMP_LINE=" cli co"
Original file line number Diff line number Diff line change 1+ require 'spec_helper'
2+
3+ describe "zsh compatibility" do
4+ let ( :completions ) { Completely ::Completions . load 'spec/fixtures/basic.yaml' }
5+ let ( :words ) { "completely generate " }
6+ let ( :tester_script ) { completions . tester . tester_script words }
7+ let ( :shell ) { 'zsh' }
8+
9+ before do
10+ reset_tmp_dir
11+ system "mkdir -p spec/tmp/somedir"
12+ File . write "spec/tmp/test.sh" , tester_script
13+ end
14+
15+ subject do
16+ Dir . chdir 'spec/tmp' do
17+ `#{ shell } test.sh` . strip
18+ end
19+ end
20+
21+ describe "completions script and test script" do
22+ it "returns completions without erroring" do
23+ expect ( subject ) . to eq "somedir --help --force"
24+ end
25+
26+ context "on bash" do
27+ let ( :shell ) { 'bash' }
28+
29+ it "returns the same output" do
30+ expect ( subject ) . to eq "somedir --help --force"
31+ end
32+ end
33+ end
34+
35+ end
You can’t perform that action at this time.
0 commit comments