Skip to content

Commit

Permalink
Revert "Merge branch 'spec'"
Browse files Browse the repository at this point in the history
This reverts commit b0583c1, reversing
changes made to 813ea7e.
  • Loading branch information
yongkangchen committed May 21, 2015
1 parent b0583c1 commit 28363a0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 37 deletions.
17 changes: 1 addition & 16 deletions spec/ctags-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ describe 'ctags', ->
expect(tags[0].name).toBe 'duplicate'
expect(tags[0].pattern).toBe '/^function duplicate() {$/'
expect(tags[0].kind).toBe 'f'
expect(tags[0].lineNumber).toBe 3

expect(tags[1].file).toBe 'tagged.js'
expect(tags[1].name).toBe 'duplicate'
expect(tags[1].pattern).toBe '/^function duplicate() {$/'
expect(tags[1].kind).toBe 'f'
expect(tags[1].lineNumber).toBe 7
expect(tags[0].kind).toBe 'f'

describe 'when partialMatch is set to true', ->
it 'returns tags that partially match the name', ->
Expand All @@ -51,14 +49,10 @@ describe 'ctags', ->
expect(tags[0].file).toBe 'tagged-duplicate.js'
expect(tags[0].name).toBe 'duplicate'
expect(tags[0].pattern).toBe '/^function duplicate() {$/'
expect(tags[0].kind).toBe 'f'
expect(tags[0].lineNumber).toBe 3

expect(tags[1].file).toBe 'tagged.js'
expect(tags[1].name).toBe 'duplicate'
expect(tags[1].pattern).toBe '/^function duplicate() {$/'
expect(tags[1].kind).toBe 'f'
expect(tags[1].lineNumber).toBe 7

describe 'when caseInsensitive is set to true', ->
it 'returns tags that match the name case insensitively', ->
Expand All @@ -78,7 +72,6 @@ describe 'ctags', ->
expect(tags[0].name).toBe 'callMeMaybe'
expect(tags[0].pattern).toBe '/^function callMeMaybe() {$/'
expect(tags[0].kind).toBe 'f'
expect(tags[0].lineNumber).toBe 3

describe '.createReadStream(tagsFilePath)', ->
it 'returns a stream that emits data and end events', ->
Expand All @@ -100,25 +93,21 @@ describe 'ctags', ->
expect(tags[0].name).toBe 'callMeMaybe'
expect(tags[0].pattern).toBe '/^function callMeMaybe() {$/'
expect(tags[0].kind).toBe 'f'
expect(tags[0].lineNumber).toBe 3

expect(tags[1].file).toBe 'tagged-duplicate.js'
expect(tags[1].name).toBe 'duplicate'
expect(tags[1].pattern).toBe '/^function duplicate() {$/'
expect(tags[1].kind).toBe 'f'
expect(tags[1].lineNumber).toBe 3

expect(tags[2].file).toBe 'tagged.js'
expect(tags[2].name).toBe 'duplicate'
expect(tags[2].pattern).toBe '/^function duplicate() {$/'
expect(tags[2].kind).toBe 'f'
expect(tags[2].lineNumber).toBe 7

expect(tags[3].file).toBe 'tagged.js'
expect(tags[3].name).toBe 'thisIsCrazy'
expect(tags[3].pattern).toBe '/^var thisIsCrazy = true;$/'
expect(tags[3].kind).toBe 'v'
expect(tags[3].lineNumber).toBe 2

it "emits an error event when the tags file does not exist", ->
missingTagsFile = path.join(__dirname, 'fixtures/not-tags')
Expand Down Expand Up @@ -152,22 +141,18 @@ describe 'ctags', ->
expect(dataHandler.argsForCall[0][0][0].name).toBe 'callMeMaybe'
expect(dataHandler.argsForCall[0][0][0].pattern).toBe '/^function callMeMaybe() {$/'
expect(dataHandler.argsForCall[0][0][0].kind).toBe 'f'
expect(dataHandler.argsForCall[0][0][0].lineNumber).toBe 3

expect(dataHandler.argsForCall[0][0][1].file).toBe 'tagged-duplicate.js'
expect(dataHandler.argsForCall[0][0][1].name).toBe 'duplicate'
expect(dataHandler.argsForCall[0][0][1].pattern).toBe '/^function duplicate() {$/'
expect(dataHandler.argsForCall[0][0][1].kind).toBe 'f'
expect(dataHandler.argsForCall[0][0][1].lineNumber).toBe 3

expect(dataHandler.argsForCall[0][0][2].file).toBe 'tagged.js'
expect(dataHandler.argsForCall[0][0][2].name).toBe 'duplicate'
expect(dataHandler.argsForCall[0][0][2].pattern).toBe '/^function duplicate() {$/'
expect(dataHandler.argsForCall[0][0][2].kind).toBe 'f'
expect(dataHandler.argsForCall[0][0][2].lineNumber).toBe 7

expect(dataHandler.argsForCall[1][0][0].file).toBe 'tagged.js'
expect(dataHandler.argsForCall[1][0][0].name).toBe 'thisIsCrazy'
expect(dataHandler.argsForCall[1][0][0].pattern).toBe '/^var thisIsCrazy = true;$/'
expect(dataHandler.argsForCall[1][0][0].kind).toBe 'v'
expect(dataHandler.argsForCall[1][0][0].lineNumber).toBe 2
6 changes: 0 additions & 6 deletions spec/fixtures/tagged-duplicate.js

This file was deleted.

11 changes: 0 additions & 11 deletions spec/fixtures/tagged.js

This file was deleted.

8 changes: 4 additions & 4 deletions spec/fixtures/tags
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
callMeMaybe tagged.js /^function callMeMaybe() {$/;" f line:3
duplicate tagged-duplicate.js /^function duplicate() {$/;" f line:3
duplicate tagged.js /^function duplicate() {$/;" f line:7
thisIsCrazy tagged.js /^var thisIsCrazy = true;$/;" v line:2
callMeMaybe tagged.js /^function callMeMaybe() {$/;" f
duplicate tagged-duplicate.js /^function duplicate() {$/;" f
duplicate tagged.js /^function duplicate() {$/;" f
thisIsCrazy tagged.js /^var thisIsCrazy = true;$/;" v

0 comments on commit 28363a0

Please sign in to comment.