twtest 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +8 -0
- data/Guardfile +12 -0
- data/lib/twtest/testcase.rb +12 -4
- data/lib/twtest/version.rb +1 -1
- data/twtest.gemspec +4 -0
- metadata +53 -3
data/.travis.yml
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
guard 'bundler' do
|
2
|
+
watch('Gemfile')
|
3
|
+
watch(/^.+\.gemspec/)
|
4
|
+
end
|
5
|
+
|
6
|
+
guard :test, :test_paths => ['test/unit', 'test/integration'] do
|
7
|
+
watch('lib/twdeps.rb'){"test"}
|
8
|
+
watch(%r{^lib/twdeps/(.+)\.rb$}){|m| "test/unit/test_#{m[1]}.rb"}
|
9
|
+
watch(%r{^test/unit/test_(.+)\.rb$})
|
10
|
+
watch('test/test_helper.rb'){"test"}
|
11
|
+
watch('test/helpers/**/*'){"test"}
|
12
|
+
end
|
data/lib/twtest/testcase.rb
CHANGED
@@ -9,23 +9,28 @@ module TaskWarrior
|
|
9
9
|
module Integration
|
10
10
|
class TestCase < ::Test::Unit::TestCase
|
11
11
|
def setup
|
12
|
+
assert(task_command_available?, "The TaskWarrior binary '#{TASK}' was not found or is not executable.")
|
12
13
|
@data_dir = Dir.mktmpdir
|
13
14
|
@taskrc_file = build_taskrc(:data_dir => @data_dir)
|
14
15
|
end
|
15
16
|
|
16
17
|
def teardown
|
17
|
-
FileUtils.rm_r(@data_dir)
|
18
|
-
File.delete(@taskrc_file)
|
18
|
+
FileUtils.rm_r(@data_dir) if @data_dir && Dir.exist?(@data_dir)
|
19
|
+
File.delete(@taskrc_file) if @taskrc_file && File.exist?(@taskrc_file)
|
19
20
|
end
|
20
21
|
|
21
22
|
protected
|
23
|
+
def task_command_available?
|
24
|
+
!%x[type -t #{TASK}].chomp.empty?
|
25
|
+
end
|
26
|
+
|
22
27
|
def export_tasks
|
23
28
|
JSON[task('export')]
|
24
29
|
end
|
25
30
|
|
26
31
|
def task(cmd)
|
27
32
|
ENV['TASKRC'] = @taskrc_file
|
28
|
-
%x[
|
33
|
+
%x[#{TASK} #{cmd}]
|
29
34
|
end
|
30
35
|
|
31
36
|
def build_taskrc(options = {})
|
@@ -38,7 +43,10 @@ module TaskWarrior
|
|
38
43
|
ensure
|
39
44
|
taskrc_file.close
|
40
45
|
end
|
41
|
-
end
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
TASK = 'task'
|
42
50
|
end
|
43
51
|
end
|
44
52
|
end
|
data/lib/twtest/version.rb
CHANGED
data/twtest.gemspec
CHANGED
@@ -13,4 +13,8 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.name = "twtest"
|
14
14
|
gem.require_paths = ["lib"]
|
15
15
|
gem.version = TaskWarrior::Test::Integration::VERSION
|
16
|
+
|
17
|
+
gem.add_development_dependency 'guard-test', '~> 0.5'
|
18
|
+
gem.add_development_dependency 'guard-bundler', '~> 1.0'
|
19
|
+
gem.add_development_dependency 'rake', '~> 0.9'
|
16
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twtest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,56 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
13
|
-
dependencies:
|
12
|
+
date: 2012-07-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: guard-test
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0.5'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.5'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: guard-bundler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '1.0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rake
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0.9'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.9'
|
14
62
|
description: Provides helpers for writing TaskWarrior integration tests in Ruby
|
15
63
|
email:
|
16
64
|
- nerab@gmx.net
|
@@ -19,7 +67,9 @@ extensions: []
|
|
19
67
|
extra_rdoc_files: []
|
20
68
|
files:
|
21
69
|
- .gitignore
|
70
|
+
- .travis.yml
|
22
71
|
- Gemfile
|
72
|
+
- Guardfile
|
23
73
|
- LICENSE
|
24
74
|
- README.md
|
25
75
|
- Rakefile
|