Skip to content

Instantly share code, notes, and snippets.

@huguesbr
Last active July 1, 2019 15:17
Show Gist options
  • Select an option

  • Save huguesbr/dc4ba10cdb47b4cf32ba2857a6ea0d87 to your computer and use it in GitHub Desktop.

Select an option

Save huguesbr/dc4ba10cdb47b4cf32ba2857a6ea0d87 to your computer and use it in GitHub Desktop.

Revisions

  1. huguesbr revised this gist Jul 1, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .bash_profile
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ rspec-match() {

    rspec-branch() {
    # will run all touches specs edited/created in current branch
    current_branch_name=`git branch | grep \* | cut -d ' ' -f2`
    current_branch_name=`git branch | grep \* | cut -d ' ' -f2`
    echo "running specs since branched off ${1:-master}"
    git diff --name-only ${1:-master} $current_branch_name | grep "^spec" | grep -v "^spec/factories"| xargs ls -d 2>/dev/null | xargs bin/rspec
    }
  2. huguesbr revised this gist Jul 1, 2019. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions .bash_profile
    Original file line number Diff line number Diff line change
    @@ -8,11 +8,11 @@ rspec-match() {
    rspec-branch() {
    # will run all touches specs edited/created in current branch
    current_branch_name=`git branch | grep \* | cut -d ' ' -f2`
    echo "running specs since branched off ${1:-master}"
    git diff --name-only ${1:-master} $current_branch_name | grep "^spec" | grep -v "^spec/factories"| xargs ls -d 2>/dev/null | xargs bin/rspec
    echo "running specs since branched off ${1:-master}"
    git diff --name-only ${1:-master} $current_branch_name | grep "^spec" | grep -v "^spec/factories"| xargs ls -d 2>/dev/null | xargs bin/rspec
    }

    rspec-failed() {
    # run previously failed specs shortcuts
    bin/rspec --only-failures
    bin/rspec --only-failures
    }
  3. huguesbr revised this gist Jul 1, 2019. No changes.
  4. huguesbr revised this gist Jul 1, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions .bash_profile
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    rspec-match() {
    # rspec-match blah
    # will run all specs matching blah
    echo "running specs matching $1"
    find spec -wholename "*$1*"| grep -v "factories"| xargs bin/rspec
    echo "running specs matching $1"
    find spec -wholename "*$1*"| grep -v "factories"| xargs bin/rspec
    }

    rspec-branch() {
  5. huguesbr created this gist Jul 1, 2019.
    18 changes: 18 additions & 0 deletions .bash_profile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    rspec-match() {
    # rspec-match blah
    # will run all specs matching blah
    echo "running specs matching $1"
    find spec -wholename "*$1*"| grep -v "factories"| xargs bin/rspec
    }

    rspec-branch() {
    # will run all touches specs edited/created in current branch
    current_branch_name=`git branch | grep \* | cut -d ' ' -f2`
    echo "running specs since branched off ${1:-master}"
    git diff --name-only ${1:-master} $current_branch_name | grep "^spec" | grep -v "^spec/factories"| xargs ls -d 2>/dev/null | xargs bin/rspec
    }

    rspec-failed() {
    # run previously failed specs shortcuts
    bin/rspec --only-failures
    }