tuberack 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b64b658bd9e4f6635163e4dff978bbd12898944
4
- data.tar.gz: 9c3b80c979a06a14812aa34dff2284da6964a661
3
+ metadata.gz: 93497339766310f69bebcc5361d88ae3ec950d43
4
+ data.tar.gz: bf7ad251a46446918dbde54311a860592c8b1e1c
5
5
  SHA512:
6
- metadata.gz: b6b48eb1f69c11cb57b61fe24003da05765d42d1b4f4a4481774f86109fb13871307504697889effa8a8cfb91ff56e94cbd14b693ffc806f584934f3f1182427
7
- data.tar.gz: 683617758e207ef1728dabe0f95fba46f23b2c180cc6ea31d5b445df731a13573ce9ce5b613c45894289fa2679efa447fca8c1f268f62f48ca2dab9cc37a41a8
6
+ metadata.gz: 6c620bd73e45a95cb7ad223c57bd84b9e1cbfef23a02fc38b20c94dc5b89630e27bac90022e5b68ad74efb2bb38813f390d0d22a5e6abeb447a6dee86f359911
7
+ data.tar.gz: b399c8ddef979e6d8636aff389af80b92f74a0f9e4a9a38afb54c0f5c6284290fec50539605cc1f0abc3bbfcafa5b6cdb036c393968edc3a9acd93fd96b22bdc
@@ -3,27 +3,37 @@ module Tuberack
3
3
  class InstallGenerator < Rails::Generators::Base
4
4
  source_root File.expand_path("../../templates", __FILE__)
5
5
 
6
- desc "Implement CodeClimate test reporter"
7
- def codeclimate_test_help
6
+ desc "Implement Coveralls test reporter"
7
+ def coveralls_test_help
8
8
  prepend_file 'test/test_helper.rb' do
9
9
  <<-EOH
10
- # Uncomment while using CodeClimate, don't forget set token
11
- # require 'codeclimate-test-reporter'
12
- # CodeClimate::TestReporter.start
10
+
11
+ Coveralls.wear! if Coveralls.should_run?
12
+ # Coveralls.wear!('rails') if Coveralls.should_run? # For RailsApp
13
13
 
14
14
  EOH
15
15
  end
16
16
  end
17
17
 
18
- desc "Implement Coveralls test reporter"
19
- def coveralls_test_help
18
+ desc "Implement Code Climate test reporter"
19
+ def codeclimate_test_help
20
20
  prepend_file 'test/test_helper.rb' do
21
21
  <<-EOH
22
- # Uncomment while using Coveralls
23
- # require 'coveralls'
24
- # Coveralls.wear!
25
- # Coveralls.wear!('rails') # For RailsApp
26
22
 
23
+ # Don't forget set token
24
+ CodeClimate::TestReporter.start
25
+ EOH
26
+ end
27
+ end
28
+
29
+ desc "Coverage tools"
30
+ def coverage_requirements
31
+ prepend_file 'test/test_helper.rb' do
32
+ <<-EOH
33
+ # Keep it on top, don't change positions
34
+ require 'simplecov'
35
+ require 'coveralls'
36
+ require 'codeclimate-test-reporter'
27
37
  EOH
28
38
  end
29
39
  end
@@ -33,11 +43,6 @@ module Tuberack
33
43
  generate 'cucumber:install'
34
44
  end
35
45
 
36
- desc "Install SimpleCov"
37
- def copy_simplecov
38
- template ".simplecov", ".simplecov"
39
- end
40
-
41
46
  desc "Implement SimpleCov into Cucumber"
42
47
  def simplecov_cucumber
43
48
  prepend_file 'features/support/env.rb' do
@@ -48,16 +53,12 @@ require 'simplecov'
48
53
  end
49
54
  end
50
55
 
51
- desc "Implement SimpleCov into tests"
52
- def simplecov_test_help
53
- prepend_file 'test/test_helper.rb' do
54
- <<-EOH
55
- require 'simplecov'
56
-
57
- EOH
58
- end
56
+ desc "Install SimpleCov"
57
+ def copy_simplecov
58
+ template ".simplecov", ".simplecov"
59
59
  end
60
60
 
61
+
61
62
  desc "Implement Capybara into tests"
62
63
  def capybara_test_help
63
64
  append_file 'test/test_helper.rb' do
@@ -73,12 +74,12 @@ end
73
74
  end
74
75
 
75
76
  desc "Implement testable into tests"
76
- def testable_test_help
77
+ def tuberack_test_help
78
+ file = File.read('test/test_helper.rb').sub(/require "rails\/test_help"\n/, "require \"rails\/test_help\"\nrequire 'tuberack'\n")
79
+ File.write('test/test_helper.rb', file)
80
+
77
81
  append_file 'test/test_helper.rb' do
78
82
  <<-EOH
79
-
80
- require 'tuberack'
81
-
82
83
  include Tuberack::Helpers
83
84
  EOH
84
85
  end
@@ -93,6 +94,15 @@ end
93
94
  EOH
94
95
  end
95
96
  end
97
+
98
+ desc "Stube web request"
99
+ def webmock_test_help
100
+ append_file 'test/test_helper.rb' do
101
+ <<-EOH
102
+ WebMock.disable_net_connect! allow: %w(coveralls.io)
103
+ EOH
104
+ end
105
+ end
96
106
  end
97
107
  end
98
108
  end
@@ -18,4 +18,7 @@ require 'factory_girl_rails'
18
18
  require 'letter_opener'
19
19
 
20
20
  # Clean database
21
- require 'database_cleaner'
21
+ require 'database_cleaner'
22
+
23
+ # Stub Web requests
24
+ require 'webmock/minitest'
@@ -1,3 +1,3 @@
1
1
  module Tuberack
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tuberack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - JiriKolarik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-21 00:00:00.000000000 Z
11
+ date: 2014-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -192,6 +192,20 @@ dependencies:
192
192
  - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: webmock
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
195
209
  - !ruby/object:Gem::Dependency
196
210
  name: bundler
197
211
  requirement: !ruby/object:Gem::Requirement