add vcr gem, add test helper script for running specific lines
This commit is contained in:
3
Gemfile
3
Gemfile
@@ -6,7 +6,8 @@ group :test do
|
|||||||
gem "mocha", :require => "mocha/setup"
|
gem "mocha", :require => "mocha/setup"
|
||||||
gem "ffaker", :git => "http://github.com/EmmanuelOga/ffaker.git"
|
gem "ffaker", :git => "http://github.com/EmmanuelOga/ffaker.git"
|
||||||
gem "simplecov", :require => false
|
gem "simplecov", :require => false
|
||||||
gem "testrbl"
|
gem "pry"
|
||||||
|
gem "vcr"
|
||||||
end
|
end
|
||||||
|
|
||||||
group :assets do
|
group :assets do
|
||||||
|
|||||||
@@ -178,7 +178,6 @@ GEM
|
|||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
tilt (~> 1.1, != 1.3.0)
|
tilt (~> 1.1, != 1.3.0)
|
||||||
term-ansicolor (1.1.4)
|
term-ansicolor (1.1.4)
|
||||||
testrbl (0.2.0)
|
|
||||||
therubyracer (0.11.4)
|
therubyracer (0.11.4)
|
||||||
libv8 (~> 3.11.8.12)
|
libv8 (~> 3.11.8.12)
|
||||||
ref
|
ref
|
||||||
@@ -198,6 +197,7 @@ GEM
|
|||||||
kgio (~> 2.6)
|
kgio (~> 2.6)
|
||||||
rack
|
rack
|
||||||
raindrops (~> 0.7)
|
raindrops (~> 0.7)
|
||||||
|
vcr (2.4.0)
|
||||||
webrobots (0.1.1)
|
webrobots (0.1.1)
|
||||||
whenever (0.8.2)
|
whenever (0.8.2)
|
||||||
activesupport (>= 2.3.4)
|
activesupport (>= 2.3.4)
|
||||||
@@ -236,8 +236,8 @@ DEPENDENCIES
|
|||||||
simple_form
|
simple_form
|
||||||
simplecov
|
simplecov
|
||||||
term-ansicolor
|
term-ansicolor
|
||||||
testrbl
|
|
||||||
therubyracer
|
therubyracer
|
||||||
uglifier (>= 1.0.3)
|
uglifier (>= 1.0.3)
|
||||||
unicorn
|
unicorn
|
||||||
|
vcr
|
||||||
whenever
|
whenever
|
||||||
|
|||||||
23
script/testing/dtest
Executable file
23
script/testing/dtest
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
|
file, line = ARGV[0], nil
|
||||||
|
test_name_pattern = nil
|
||||||
|
|
||||||
|
if file =~ /:\d+/
|
||||||
|
file, line = file.split(/:/)
|
||||||
|
end
|
||||||
|
|
||||||
|
if line
|
||||||
|
text = File.read(file).split(/\r\n|\r|\n/)[line.to_i - 1]
|
||||||
|
if text =~ /(?:context|should) ["'](.+?)["']/
|
||||||
|
test_name_pattern = Regexp.escape($1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
env_options = {
|
||||||
|
"TEST" => file
|
||||||
|
}
|
||||||
|
|
||||||
|
env_options["TESTOPTS"] = "--name='/#{test_name_pattern}/'" if test_name_pattern
|
||||||
|
|
||||||
|
exec(env_options, "bundle exec rake test")
|
||||||
Reference in New Issue
Block a user