testrbl 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testrbl (0.1.8)
4
+ testrbl (0.1.9)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/lib/testrbl.rb CHANGED
@@ -14,6 +14,8 @@ module Testrbl
14
14
  /\W+/u
15
15
  end
16
16
 
17
+ INTERPOLATION = /\\\#\\\{.*?\\\}/
18
+
17
19
  def self.run_from_cli(argv)
18
20
  command = argv.join(" ")
19
21
  if command =~ /^\S+:\d+$/
@@ -58,7 +60,7 @@ module Testrbl
58
60
  PATTERNS.each do |r|
59
61
  if line =~ r
60
62
  whitespace, method, test_name = $1, $2, $3
61
- regex = Regexp.escape(test_name).gsub("'",".").gsub("\\ "," ")
63
+ regex = Regexp.escape(test_name).gsub("'",".").gsub("\\ "," ").gsub(INTERPOLATION, ".*")
62
64
 
63
65
  if method == "should"
64
66
  regex = "#{method} #{regex}\. $"
@@ -1,3 +1,3 @@
1
1
  module Testrbl
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  end
data/spec/testrbl_spec.rb CHANGED
@@ -356,10 +356,18 @@ describe Testrbl do
356
356
  call(" test \"c -__.BLA:\" do\n").should == [" ", "^test(: |_)c.\\-__\\.BLA:$"]
357
357
  end
358
358
 
359
+ it "finds interpolated test do calls" do
360
+ call(" test \"c\#{111}b\" do\n").should == [" ", "^test(: |_)c.*b$"]
361
+ end
362
+
359
363
  it "finds should do calls" do
360
364
  call(" should \"xx xx\" do\n").should == [" ", "should xx xx. $"]
361
365
  end
362
366
 
367
+ it "finds interpolated context do calls" do
368
+ call(" should \"c\#{111}b\" do\n").should == [" ", "should c.*b. $"]
369
+ end
370
+
363
371
  it "finds context do calls" do
364
372
  call(" context \"xx xx\" do\n").should == [" ", "xx xx"]
365
373
  end
@@ -368,6 +376,10 @@ describe Testrbl do
368
376
  call(" context Foobar do\n").should == [" ", "Foobar"]
369
377
  end
370
378
 
379
+ it "finds interpolated context do calls" do
380
+ call(" context \"c\#{111}b\" do\n").should == [" ", "c.*b"]
381
+ end
382
+
371
383
  it "finds minitest it do calls" do
372
384
  call(" it \"xx xx\" do\n").should == [" ", "\\d+_xx_xx$"]
373
385
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testrbl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-13 00:00:00.000000000 Z
12
+ date: 2012-06-19 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: michael@grosser.it
@@ -44,7 +44,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
44
44
  version: '0'
45
45
  segments:
46
46
  - 0
47
- hash: 3374210178778047686
47
+ hash: 2807004336236414873
48
48
  required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  version: '0'
54
54
  segments:
55
55
  - 0
56
- hash: 3374210178778047686
56
+ hash: 2807004336236414873
57
57
  requirements: []
58
58
  rubyforge_project:
59
59
  rubygems_version: 1.8.24