infinity_test 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/.gitignore +3 -0
  2. data/.infinity_test +30 -2
  3. data/.rspec +2 -0
  4. data/.rvmrc +1 -1
  5. data/Gemfile +10 -2
  6. data/Gemfile.lock +52 -12
  7. data/History.markdown +86 -2
  8. data/LICENSE.txt +22 -0
  9. data/Rakefile +25 -9
  10. data/Readme.markdown +47 -23
  11. data/TODO.markdown +12 -0
  12. data/Tasks +2 -3
  13. data/VERSION.yml +2 -2
  14. data/bin/infinity_test +1 -1
  15. data/features/heuristics.feature +23 -0
  16. data/features/support/env.rb +2 -0
  17. data/images/fuuu/failure.png +0 -0
  18. data/images/fuuu/pending.png +0 -0
  19. data/images/fuuu/sucess.png +0 -0
  20. data/infinity_test.gemspec +62 -29
  21. data/lib/infinity_test.rb +29 -9
  22. data/lib/infinity_test/application.rb +222 -68
  23. data/lib/infinity_test/application_library/rails.rb +94 -0
  24. data/lib/infinity_test/application_library/rubygems.rb +43 -0
  25. data/lib/infinity_test/binary_path.rb +30 -8
  26. data/lib/infinity_test/builder.rb +56 -0
  27. data/lib/infinity_test/command.rb +18 -24
  28. data/lib/infinity_test/configuration.rb +96 -44
  29. data/lib/infinity_test/continuous_testing.rb +17 -39
  30. data/lib/infinity_test/dependencies.rb +76 -41
  31. data/lib/infinity_test/environment.rb +15 -0
  32. data/lib/infinity_test/heuristics.rb +36 -0
  33. data/lib/infinity_test/heuristics_helper.rb +9 -0
  34. data/lib/infinity_test/options.rb +56 -19
  35. data/lib/infinity_test/runner.rb +25 -17
  36. data/lib/infinity_test/test_framework.rb +109 -0
  37. data/lib/infinity_test/test_library/bacon.rb +55 -0
  38. data/lib/infinity_test/test_library/cucumber.rb +22 -0
  39. data/lib/infinity_test/test_library/rspec.rb +58 -0
  40. data/lib/infinity_test/test_library/test_unit.rb +46 -0
  41. data/spec/factories/company/Gemfile +0 -0
  42. data/spec/factories/infinity_test_example +2 -2
  43. data/spec/infinity_test/application_library/rails_spec.rb +140 -0
  44. data/spec/infinity_test/application_library/rubygems_spec.rb +52 -0
  45. data/spec/infinity_test/application_spec.rb +274 -50
  46. data/spec/infinity_test/binary_path_spec.rb +72 -0
  47. data/spec/infinity_test/builder_spec.rb +7 -0
  48. data/spec/infinity_test/command_spec.rb +13 -14
  49. data/spec/infinity_test/configuration_spec.rb +183 -57
  50. data/spec/infinity_test/continuous_testing_spec.rb +19 -1
  51. data/spec/infinity_test/environment_spec.rb +23 -0
  52. data/spec/infinity_test/heuristics_helper_spec.rb +15 -0
  53. data/spec/infinity_test/heuristics_spec.rb +127 -0
  54. data/spec/infinity_test/options_spec.rb +48 -26
  55. data/spec/infinity_test/runner_spec.rb +37 -29
  56. data/spec/infinity_test/test_framework_spec.rb +127 -0
  57. data/spec/infinity_test/test_library/bacon_spec.rb +150 -0
  58. data/spec/infinity_test/test_library/cucumber_spec.rb +8 -0
  59. data/spec/infinity_test/test_library/rspec_spec.rb +185 -0
  60. data/spec/infinity_test/test_library/test_unit_spec.rb +184 -0
  61. data/spec/infinity_test_spec.rb +23 -12
  62. data/spec/spec_helper.rb +86 -30
  63. metadata +62 -32
  64. data/lib/infinity_test/notifications/growl.rb +0 -15
  65. data/lib/infinity_test/notifications/lib_notify.rb +0 -11
  66. data/lib/infinity_test/rspec.rb +0 -87
  67. data/lib/infinity_test/test_unit.rb +0 -74
  68. data/spec/infinity_test/notifications/growl_spec.rb +0 -9
  69. data/spec/infinity_test/notifications/lib_notify_spec.rb +0 -9
  70. data/spec/infinity_test/rspec_spec.rb +0 -189
  71. data/spec/infinity_test/test_unit_spec.rb +0 -182
  72. data/spec/spec.opts +0 -1
@@ -1,29 +1,40 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe InfinityTest do
4
-
5
- describe '#application' do
6
-
4
+
5
+ describe '.application' do
6
+
7
7
  it "should be a instace of Application" do
8
8
  InfinityTest.application.should be_instance_of(InfinityTest::Application)
9
9
  end
10
-
10
+
11
11
  it "should cache instance variable in the same object" do
12
12
  application = InfinityTest.application
13
13
  InfinityTest.application.should equal application
14
14
  end
15
-
15
+
16
16
  end
17
-
18
- describe '#configuration' do
19
-
17
+
18
+ describe '.configuration' do
19
+
20
20
  it { InfinityTest.configuration.should be_instance_of(InfinityTest::Configuration) }
21
-
21
+
22
22
  it "should cache the instance of configuration class" do
23
23
  configuration = InfinityTest.configuration
24
24
  configuration.should equal InfinityTest.configuration
25
25
  end
26
-
26
+
27
27
  end
28
-
29
- end
28
+
29
+ describe '.watchr' do
30
+
31
+ it { InfinityTest.watchr.should be_instance_of(Watchr::Script) }
32
+
33
+ it "should cache the instance of Watchr script class" do
34
+ watchr = InfinityTest.watchr
35
+ watchr.should equal InfinityTest.watchr
36
+ end
37
+
38
+ end
39
+
40
+ end
@@ -1,71 +1,73 @@
1
- require 'rubygems'
2
1
 
3
2
  require 'infinity_test'
4
-
5
- begin
6
- require 'spec'
7
- rescue LoadError
8
- require 'rspec'
9
- end
10
-
11
3
  require 'watchr'
4
+ # require 'simplecov'
5
+ # SimpleCov.start do
6
+ # add_filter '/spec'
7
+ # add_filter './.infinity_test'
8
+ # end
9
+
10
+ RSpec.configure do |config|
12
11
 
13
- def stub_home_config(options)
14
- File.should_receive(:expand_path).with('~/.infinity_test').and_return(options[:file])
12
+ def stub_application_with_rspec
13
+ InfinityTest.stub!(:application).and_return(application_with_rspec)
15
14
  end
16
-
17
- def read_and_load_home_config(options)
18
- stub_home_config :file => options[:file]
19
- @application.load_configuration_file
15
+
16
+ def stub_application_with_test_unit
17
+ InfinityTest.stub!(:application).and_return(application_with_test_unit)
20
18
  end
21
-
19
+
22
20
  def application_with(options)
23
21
  application = InfinityTest::Application.new
24
22
  application.config.use(options)
25
23
  application
26
24
  end
27
-
25
+
28
26
  def application_with_rspec
29
- application = InfinityTest::Application.new
30
- application.config.use(:test_framework => :rspec)
31
- application
27
+ application_with(:test_framework => :rspec)
32
28
  end
33
29
 
34
30
  def application_with_test_unit
35
- application = InfinityTest::Application.new
36
- application.config.use(:test_framework => :test_unit)
37
- application
31
+ application_with(:test_framework => :test_unit)
32
+ end
33
+
34
+ def application_with_rails
35
+ application_with(:app_framework => :rails)
38
36
  end
39
-
37
+
38
+ def application_with_rubygems
39
+ application_with(:app_framework => :rubygems)
40
+ end
41
+
40
42
  def application_with_growl
41
43
  application = InfinityTest::Application.new
42
44
  application.config.notifications :growl
43
45
  application
44
46
  end
45
-
47
+
46
48
  def new_application(options)
47
49
  application = InfinityTest::Application.new
48
50
  application.config.notifications options[:notifications] if options[:notifications]
49
51
  application.config.use(options) if options
50
52
  application
51
53
  end
52
-
54
+
53
55
  def continuous_testing_with(application)
54
56
  InfinityTest::ContinuousTesting.new(:application => application)
55
57
  end
56
-
58
+
57
59
  def image(basename)
58
60
  File.expand_path(File.join(File.dirname(__FILE__), '..', 'images', basename))
59
61
  end
60
-
62
+
61
63
  def custom_image(basename)
62
64
  File.expand_path(File.join(File.dirname(__FILE__), 'factories', basename))
63
65
  end
64
-
66
+
65
67
  def custom_image_dir
66
68
  File.expand_path(File.join(File.dirname(__FILE__), 'factories', 'images'))
67
69
  end
68
-
70
+
69
71
  def run_the_command(app)
70
72
  command = mock(InfinityTest::Command)
71
73
  command.should_receive(:results).at_least(:once).and_return('0 examples, 0 failures')
@@ -73,4 +75,58 @@ require 'watchr'
73
75
  app.should_receive(:notify!).and_return(nil)
74
76
  app.run!(['spec'])
75
77
  end
76
-
78
+
79
+ def factory_company_gemfile
80
+ File.expand_path(File.join(File.dirname(__FILE__), 'factories', 'company', 'Gemfile'))
81
+ end
82
+
83
+ def factory_buzz_gemfile
84
+ File.expand_path(File.join(File.dirname(__FILE__), 'factories', 'buzz', 'Gemfile'))
85
+ end
86
+
87
+ def current_env
88
+ @current_env ||= RVM::Environment.current
89
+ end
90
+
91
+ def environment_name
92
+ @environment_name ||= current_env.environment_name
93
+ end
94
+
95
+ def application_with_gemfile(application)
96
+ application.should_receive(:have_gemfile?).and_return(true)
97
+ application.should_receive(:skip_bundler?).and_return(false)
98
+ end
99
+
100
+ def application_without_gemfile(application)
101
+ application.should_receive(:have_gemfile?).and_return(false)
102
+ end
103
+
104
+ # Factories! Or Fixtures - Whathever
105
+
106
+ def buzz_library(&block)
107
+ factories_for('buzz', &block)
108
+ end
109
+
110
+ def wood_library(&block)
111
+ factories_for('wood', &block)
112
+ end
113
+
114
+ def slinky_library(&block)
115
+ factories_for('slinky', &block)
116
+ end
117
+
118
+ def factories_for(directory, &block)
119
+ Dir.chdir("#{infinity_test_root}/spec/factories/#{directory}", &block)
120
+ end
121
+
122
+ def infinity_test_root
123
+ File.expand_path(File.join(File.dirname(__FILE__), '..'))
124
+ end
125
+
126
+ end
127
+
128
+ RSpec::Matchers.define :have_pattern do |expected|
129
+ match do |heuristics|
130
+ heuristics.patterns.should have_key(expected)
131
+ end
132
+ end
metadata CHANGED
@@ -3,10 +3,10 @@ name: infinity_test
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
+ - 1
6
7
  - 0
7
- - 2
8
8
  - 0
9
- version: 0.2.0
9
+ version: 1.0.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tomas D'Stefano
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-29 00:00:00 -03:00
17
+ date: 2010-11-16 00:00:00 -02:00
18
18
  default_executable: infinity_test
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  type: :runtime
33
33
  version_requirements: *id001
34
34
  - !ruby/object:Gem::Dependency
35
- name: rspec
35
+ name: notifiers
36
36
  prerelease: false
37
37
  requirement: &id002 !ruby/object:Gem::Requirement
38
38
  none: false
@@ -41,13 +41,13 @@ dependencies:
41
41
  - !ruby/object:Gem::Version
42
42
  segments:
43
43
  - 1
44
- - 3
44
+ - 1
45
45
  - 0
46
- version: 1.3.0
47
- type: :development
46
+ version: 1.1.0
47
+ type: :runtime
48
48
  version_requirements: *id002
49
49
  - !ruby/object:Gem::Dependency
50
- name: cucumber
50
+ name: rspec
51
51
  prerelease: false
52
52
  requirement: &id003 !ruby/object:Gem::Requirement
53
53
  none: false
@@ -55,14 +55,14 @@ dependencies:
55
55
  - - ">="
56
56
  - !ruby/object:Gem::Version
57
57
  segments:
58
- - 0
59
- - 6
60
58
  - 2
61
- version: 0.6.2
59
+ - 0
60
+ - 1
61
+ version: 2.0.1
62
62
  type: :development
63
63
  version_requirements: *id003
64
64
  - !ruby/object:Gem::Dependency
65
- name: aruba
65
+ name: jeweler
66
66
  prerelease: false
67
67
  requirement: &id004 !ruby/object:Gem::Requirement
68
68
  none: false
@@ -70,20 +70,20 @@ dependencies:
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  segments:
73
- - 0
74
73
  - 1
75
- - 7
76
- version: 0.1.7
74
+ - 4
75
+ - 0
76
+ version: 1.4.0
77
77
  type: :development
78
78
  version_requirements: *id004
79
- description: Infinity Test is a continuous testing library and a flexible alternative to Autotest, using Watchr library with Rspec OR Test::Unit with RVM funcionality, giving the possibility to test with all Rubies that you have in your RVM configuration.
79
+ description: Infinity Test is a continuous testing library and a flexible alternative to Autotest, using Watchr library with Rspec, Test::Unit or Bacon with RVM funcionality, giving the possibility to test with all Rubies that you have in your RVM configuration.
80
80
  email: tomasdestefi@gmail.com
81
81
  executables:
82
82
  - infinity_test
83
83
  extensions: []
84
84
 
85
- extra_rdoc_files: []
86
-
85
+ extra_rdoc_files:
86
+ - LICENSE.txt
87
87
  files:
88
88
  - .gitignore
89
89
  - .infinity_test
@@ -92,17 +92,24 @@ files:
92
92
  - Gemfile
93
93
  - Gemfile.lock
94
94
  - History.markdown
95
+ - LICENSE.txt
95
96
  - Rakefile
96
97
  - Readme.markdown
98
+ - TODO.markdown
97
99
  - Tasks
98
100
  - VERSION.yml
99
101
  - bin/infinity_test
100
102
  - buzz_images/buzz_lightyear.jpg
101
103
  - buzz_images/buzz_lightyear_continencia.gif
102
104
  - buzz_images/to_infinity_and_beyond.png
105
+ - features/heuristics.feature
106
+ - features/support/env.rb
103
107
  - images/faces/failure.png
104
108
  - images/faces/pending.png
105
109
  - images/faces/sucess.png
110
+ - images/fuuu/failure.png
111
+ - images/fuuu/pending.png
112
+ - images/fuuu/sucess.png
106
113
  - images/hands/failure.png
107
114
  - images/hands/pending.png
108
115
  - images/hands/sucess.png
@@ -127,20 +134,28 @@ files:
127
134
  - infinity_test.gemspec
128
135
  - lib/infinity_test.rb
129
136
  - lib/infinity_test/application.rb
137
+ - lib/infinity_test/application_library/rails.rb
138
+ - lib/infinity_test/application_library/rubygems.rb
130
139
  - lib/infinity_test/binary_path.rb
140
+ - lib/infinity_test/builder.rb
131
141
  - lib/infinity_test/command.rb
132
142
  - lib/infinity_test/configuration.rb
133
143
  - lib/infinity_test/continuous_testing.rb
134
144
  - lib/infinity_test/dependencies.rb
135
- - lib/infinity_test/notifications/growl.rb
136
- - lib/infinity_test/notifications/lib_notify.rb
145
+ - lib/infinity_test/environment.rb
146
+ - lib/infinity_test/heuristics.rb
147
+ - lib/infinity_test/heuristics_helper.rb
137
148
  - lib/infinity_test/options.rb
138
- - lib/infinity_test/rspec.rb
139
149
  - lib/infinity_test/runner.rb
140
- - lib/infinity_test/test_unit.rb
150
+ - lib/infinity_test/test_framework.rb
151
+ - lib/infinity_test/test_library/bacon.rb
152
+ - lib/infinity_test/test_library/cucumber.rb
153
+ - lib/infinity_test/test_library/rspec.rb
154
+ - lib/infinity_test/test_library/test_unit.rb
141
155
  - lib/infinity_test/test_unit_loader.rb
142
156
  - spec/factories/buzz/lib/buzz.rb
143
157
  - spec/factories/buzz/spec/buzz_spec.rb
158
+ - spec/factories/company/Gemfile
144
159
  - spec/factories/company/lib/company.rb
145
160
  - spec/factories/company/test/company_test.rb
146
161
  - spec/factories/images/failure.png
@@ -154,24 +169,31 @@ files:
154
169
  - spec/factories/travel/test/travel_test.rb
155
170
  - spec/factories/wood/lib/wood.rb
156
171
  - spec/factories/wood/spec/wood_spec.rb
172
+ - spec/infinity_test/application_library/rails_spec.rb
173
+ - spec/infinity_test/application_library/rubygems_spec.rb
157
174
  - spec/infinity_test/application_spec.rb
175
+ - spec/infinity_test/binary_path_spec.rb
176
+ - spec/infinity_test/builder_spec.rb
158
177
  - spec/infinity_test/command_spec.rb
159
178
  - spec/infinity_test/configuration_spec.rb
160
179
  - spec/infinity_test/continuous_testing_spec.rb
161
- - spec/infinity_test/notifications/growl_spec.rb
162
- - spec/infinity_test/notifications/lib_notify_spec.rb
180
+ - spec/infinity_test/environment_spec.rb
181
+ - spec/infinity_test/heuristics_helper_spec.rb
182
+ - spec/infinity_test/heuristics_spec.rb
163
183
  - spec/infinity_test/options_spec.rb
164
- - spec/infinity_test/rspec_spec.rb
165
184
  - spec/infinity_test/runner_spec.rb
166
- - spec/infinity_test/test_unit_spec.rb
185
+ - spec/infinity_test/test_framework_spec.rb
186
+ - spec/infinity_test/test_library/bacon_spec.rb
187
+ - spec/infinity_test/test_library/cucumber_spec.rb
188
+ - spec/infinity_test/test_library/rspec_spec.rb
189
+ - spec/infinity_test/test_library/test_unit_spec.rb
167
190
  - spec/infinity_test_spec.rb
168
- - spec/spec.opts
169
191
  - spec/spec_helper.rb
170
192
  has_rdoc: true
171
193
  homepage: http://github.com/tomas-stefano/infinity_test
172
194
  licenses: []
173
195
 
174
- post_install_message: "\n --------------------------------------------------------------------------------\n T O I N F I N I T Y A N D B E Y O N D !!!\n\n The Infinity uses the awesome RVM to run. \n If you don't have the RVM installed, stop what you doing =p.\n RVM Installation Instructions:\n http://rvm.beginrescueend.com/rvm/install/ \n And don't forget to see how you can customize Infinity Test here: \n http://github.com/tomas-stefano/infinity_test/wiki/Customize-Infinity-Test\n\n Happy Coding! :)\n\n --------------------------------------------------------------------------------\n \n"
196
+ post_install_message: "\n --------------------------------------------------------------------------------\n T O I N F I N I T Y A N D B E Y O N D !!!\n\n The Infinity uses the awesome RVM to run.\n If you don't have the RVM installed, stop what you doing =p.\n RVM Installation Instructions:\n http://rvm.beginrescueend.com/rvm/install/\n And don't forget to see how you can customize Infinity Test here:\n http://github.com/tomas-stefano/infinity_test/wiki/Customize-Infinity-Test\n\n Happy Coding! :)\n\n --------------------------------------------------------------------------------\n\n"
175
197
  rdoc_options:
176
198
  - --charset=UTF-8
177
199
  require_paths:
@@ -210,15 +232,23 @@ test_files:
210
232
  - spec/factories/travel/test/travel_test.rb
211
233
  - spec/factories/wood/lib/wood.rb
212
234
  - spec/factories/wood/spec/wood_spec.rb
235
+ - spec/infinity_test/application_library/rails_spec.rb
236
+ - spec/infinity_test/application_library/rubygems_spec.rb
213
237
  - spec/infinity_test/application_spec.rb
238
+ - spec/infinity_test/binary_path_spec.rb
239
+ - spec/infinity_test/builder_spec.rb
214
240
  - spec/infinity_test/command_spec.rb
215
241
  - spec/infinity_test/configuration_spec.rb
216
242
  - spec/infinity_test/continuous_testing_spec.rb
217
- - spec/infinity_test/notifications/growl_spec.rb
218
- - spec/infinity_test/notifications/lib_notify_spec.rb
243
+ - spec/infinity_test/environment_spec.rb
244
+ - spec/infinity_test/heuristics_helper_spec.rb
245
+ - spec/infinity_test/heuristics_spec.rb
219
246
  - spec/infinity_test/options_spec.rb
220
- - spec/infinity_test/rspec_spec.rb
221
247
  - spec/infinity_test/runner_spec.rb
222
- - spec/infinity_test/test_unit_spec.rb
248
+ - spec/infinity_test/test_framework_spec.rb
249
+ - spec/infinity_test/test_library/bacon_spec.rb
250
+ - spec/infinity_test/test_library/cucumber_spec.rb
251
+ - spec/infinity_test/test_library/rspec_spec.rb
252
+ - spec/infinity_test/test_library/test_unit_spec.rb
223
253
  - spec/infinity_test_spec.rb
224
254
  - spec/spec_helper.rb
@@ -1,15 +0,0 @@
1
- module InfinityTest
2
- module Notifications
3
- class Growl
4
-
5
- # Notification via Growl
6
- #
7
- # Growl.new.notify(:ruby_version => "Ruby 1.9.2", :message => "0 examples, 0 failures", :image => 'image.png')
8
- #
9
- def notify(options)
10
- system "growlnotify -n infinity_test -m '#{options[:message]}' -t 'Ruby #{options[:title]}' --image #{options[:image]} -n infinity_test"
11
- end
12
-
13
- end
14
- end
15
- end
@@ -1,11 +0,0 @@
1
- module InfinityTest
2
- module Notifications
3
- class LibNotify
4
-
5
- def notify(options)
6
- system "notify-send --expire-time 3000 --icon #{options[:image]} 'Ruby #{options[:title]}' '#{options[:message]}'"
7
- end
8
-
9
- end
10
- end
11
- end