cant_wait 0.0.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +6 -14
  2. checksums.yaml.gz.sig +0 -0
  3. data/.travis.yml +2 -3
  4. data/{CHANGELOG.md → CHANGELOG.markdown} +14 -0
  5. data/{README.md → README.markdown} +5 -6
  6. data/Rakefile +3 -4
  7. data/cert/{README.md → README.markdown} +1 -1
  8. data/lib/cant_wait/version.rb +1 -1
  9. data/tasks/testing.rake +61 -61
  10. data/test/{README.md → README.markdown} +7 -13
  11. data/test/cant_wait_test.rb +61 -40
  12. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/Gemfile +25 -2
  13. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/README.rdoc +0 -0
  14. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/Rakefile +1 -1
  15. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/app/assets/images/rails.png +0 -0
  16. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/app/assets/javascripts/application.js +0 -0
  17. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/app/assets/stylesheets/application.css +0 -0
  18. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/app/controllers/application_controller.rb +0 -0
  19. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/app/helpers/application_helper.rb +0 -0
  20. data/test/test_apps/{Test_3_1_12/log → Test_3_2_15/app/mailers}/.gitkeep +0 -0
  21. data/test/test_apps/{Test_3_2_14/app/mailers → Test_3_2_15/app/models}/.gitkeep +0 -0
  22. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/app/views/layouts/application.html.erb +1 -1
  23. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/application.rb +1 -1
  24. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/boot.rb +0 -0
  25. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/environment.rb +1 -1
  26. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/environments/development.rb +1 -1
  27. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/environments/production.rb +1 -1
  28. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/environments/test.rb +1 -1
  29. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/initializers/backtrace_silencers.rb +0 -0
  30. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/initializers/inflections.rb +0 -0
  31. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/initializers/mime_types.rb +0 -0
  32. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/initializers/secret_token.rb +1 -1
  33. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/initializers/session_store.rb +2 -2
  34. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/initializers/wrap_parameters.rb +0 -0
  35. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/locales/en.yml +0 -0
  36. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config/routes.rb +1 -1
  37. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/config.ru +1 -1
  38. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/db/seeds.rb +0 -0
  39. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/doc/README_FOR_APP +0 -0
  40. data/test/test_apps/{Test_3_2_14/app/models → Test_3_2_15/lib/assets}/.gitkeep +0 -0
  41. data/test/test_apps/{Test_3_2_14/lib/assets → Test_3_2_15/lib/tasks}/.gitkeep +0 -0
  42. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/public/404.html +0 -0
  43. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/public/422.html +0 -0
  44. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/public/500.html +0 -0
  45. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/public/favicon.ico +0 -0
  46. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/public/index.html +0 -0
  47. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/public/robots.txt +0 -0
  48. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/script/rails +0 -0
  49. data/test/test_apps/{Test_3_2_14/lib/tasks → Test_3_2_15/test/fixtures}/.gitkeep +0 -0
  50. data/test/test_apps/{Test_3_2_14/log → Test_3_2_15/test/functional}/.gitkeep +0 -0
  51. data/test/test_apps/{Test_3_2_14/test/fixtures → Test_3_2_15/test/integration}/.gitkeep +0 -0
  52. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/test/performance/browsing_test.rb +0 -0
  53. data/test/test_apps/{Test_3_2_14 → Test_3_2_15}/test/test_helper.rb +0 -0
  54. data/test/test_apps/{Test_3_2_14/test/functional → Test_3_2_15/test/unit}/.gitkeep +0 -0
  55. data/test/test_apps/{Test_3_2_14/test/integration → Test_3_2_15/vendor/assets/javascripts}/.gitkeep +0 -0
  56. data/test/test_apps/{Test_3_2_14/test/unit → Test_3_2_15/vendor/assets/stylesheets}/.gitkeep +0 -0
  57. data/test/test_apps/{Test_3_2_14/vendor/assets/javascripts → Test_3_2_15/vendor/plugins}/.gitkeep +0 -0
  58. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/Gemfile +16 -1
  59. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/README.rdoc +0 -0
  60. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/Rakefile +1 -1
  61. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/app/assets/images/.keep +0 -0
  62. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/app/assets/javascripts/application.js +0 -0
  63. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/app/assets/stylesheets/application.css +0 -0
  64. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/app/controllers/application_controller.rb +0 -0
  65. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/app/controllers/concerns/.keep +0 -0
  66. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/app/helpers/application_helper.rb +0 -0
  67. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/app/mailers/.keep +0 -0
  68. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/app/models/.keep +0 -0
  69. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/app/models/concerns/.keep +0 -0
  70. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/app/views/layouts/application.html.erb +1 -1
  71. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/bin/bundle +0 -0
  72. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/bin/rails +0 -0
  73. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/bin/rake +0 -0
  74. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/application.rb +1 -1
  75. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/boot.rb +0 -0
  76. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/environment.rb +1 -1
  77. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/environments/development.rb +1 -1
  78. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/environments/production.rb +1 -1
  79. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/environments/test.rb +1 -1
  80. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/initializers/backtrace_silencers.rb +0 -0
  81. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/initializers/filter_parameter_logging.rb +0 -0
  82. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/initializers/inflections.rb +0 -0
  83. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/initializers/mime_types.rb +0 -0
  84. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/initializers/secret_token.rb +1 -1
  85. data/test/test_apps/Test_4_0_1/config/initializers/session_store.rb +3 -0
  86. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/initializers/wrap_parameters.rb +0 -0
  87. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/locales/en.yml +0 -0
  88. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config/routes.rb +2 -2
  89. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/config.ru +0 -0
  90. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/db/seeds.rb +0 -0
  91. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/lib/assets/.keep +0 -0
  92. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/lib/tasks/.keep +0 -0
  93. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/log/.keep +0 -0
  94. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/public/404.html +0 -0
  95. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/public/422.html +0 -0
  96. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/public/500.html +0 -0
  97. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/public/favicon.ico +0 -0
  98. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/public/robots.txt +0 -0
  99. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/test/controllers/.keep +0 -0
  100. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/test/fixtures/.keep +0 -0
  101. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/test/helpers/.keep +0 -0
  102. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/test/integration/.keep +0 -0
  103. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/test/mailers/.keep +0 -0
  104. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/test/models/.keep +0 -0
  105. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/test/test_helper.rb +0 -0
  106. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/vendor/assets/javascripts/.keep +0 -0
  107. data/test/test_apps/{Test_4_0_0 → Test_4_0_1}/vendor/assets/stylesheets/.keep +0 -0
  108. data.tar.gz.sig +0 -0
  109. metadata +226 -238
  110. metadata.gz.sig +0 -0
  111. data/test/test_apps/Test_3_2_14/vendor/assets/stylesheets/.gitkeep +0 -0
  112. data/test/test_apps/Test_3_2_14/vendor/plugins/.gitkeep +0 -0
  113. data/test/test_apps/Test_4_0_0/config/initializers/session_store.rb +0 -3
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YWJhMmUzZDZjYjBhMmVjN2FiZjk4YTdjNjcwMTY2ZTYyY2EyYzBjMQ==
5
- data.tar.gz: !binary |-
6
- MmZmYzczMjRiZTRiN2I5NGRmMDhkNTZlODI5YTdmNDA1ZmRlNDYxMw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZTIzNzc0MzA4Yzg4YTI5MGExNjJmNzE2OGYyOTg5OWJhZjJkMTQwNGY1YTM5
10
- ODM5MWFjZjEyN2Y1NDUyZjRiMjRiM2E1MzcyMzEzNDk0YzE3NzUwNjYyNmM2
11
- MTBjNmJjMjU4MzI3OTBlMzA3NmFhYjVlMGNmODYyZDg3NGYyNTA=
12
- data.tar.gz: !binary |-
13
- MTI2ZjIwNjRkNGY4YjU4YmNjODQ4ZmZhZjA4MWVkZjEwN2M4MzdkOTdlNjA2
14
- YzdjMGY2Mjg4NjU5M2NhNTQ1MGUyNjM4N2FmYjUxNjY1ZjNkZGJjZDBkNGE0
15
- NTExZmUxMDI1ODZhYzg0YzIzZGEyNWM2ODE0MDU1MTc0ZGM1YmE=
2
+ SHA1:
3
+ metadata.gz: 44cdbe394eedf5931605f6af0e2e8821cbd4ffc1
4
+ data.tar.gz: a6819104edf356b00592bb9666c4c3e0787e75b5
5
+ SHA512:
6
+ metadata.gz: 52603bec0c9071b0bc0e59f8e68c138197a7a110f54ea586f2fdcceed26f0228e70ceb7b86edfc5d7bb7edf438829ccfbfd00dde3a34a31aca9aad01e3d5e6f0
7
+ data.tar.gz: 53376e31d02ecd2b52a128b85bc818d7966bf15e83c2d3089f0932a3a06ec22689e172944f8a528ad8c41eddb7339961b745dd75b680bed24c20bbfc3413e5e7
checksums.yaml.gz.sig CHANGED
Binary file
data/.travis.yml CHANGED
@@ -4,12 +4,11 @@ rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
6
  - jruby-19mode # JRuby in 1.9 mode
7
- - rbx-19mode # Rubinius in 1.9 mode
8
7
  before_script:
9
8
  # Before, Travis does a bundle install (cant_wait's Gemfile), which installs the last version of Rails
10
9
  - psql -c "CREATE ROLE tester WITH LOGIN PASSWORD 'secret';" -U postgres
11
10
  - psql -c 'CREATE DATABASE test WITH OWNER=tester;' -U postgres
12
11
  # We remove Rails to allow the installation of previous versions:
13
12
  - gem uninstall rails
14
- - rake test:bundle
15
- script: rake test:run
13
+ - rake test:bundle REBUILD=yes
14
+ script: rake
@@ -44,3 +44,17 @@ Development:
44
44
  - Minor tweaks in the tests
45
45
  - Tested with new patches of MRI for C Ruby 1.9.3 and 2.0.0
46
46
  - Tests for Rails 3.2.14
47
+
48
+ 1.0.0 (November 20, 2013)
49
+ =========================
50
+
51
+ Documentation:
52
+
53
+ - Bumped the version to 1.0.0, to signal that it is ready for production. It was actually ready since version 0.0.1, so this change is just to avoid a possible confusion.
54
+
55
+ Development:
56
+
57
+ - Minor tweaks in the test code.
58
+ - Tests for Rails 3.2.15 and 4.0.1
59
+ - Set up of the default rake test to run all the tests, without preparing the data (equivalent to <tt>rake test:run</tt>)
60
+ - Changes in Travis-CI configuration, discontinuing support for Rubinius, while bugs in its interpreter get sorted out.
@@ -32,7 +32,7 @@ If any SQL statement takes more time than the timeout value (measured in millise
32
32
 
33
33
  Add this line to your application's Gemfile:
34
34
 
35
- gem 'cant_wait', '~> 0.0.4'
35
+ gem 'cant_wait', '~> 1.0.0'
36
36
 
37
37
  And then execute:
38
38
 
@@ -53,7 +53,7 @@ Then restart the application to establish the new database settings.
53
53
 
54
54
  ## Dependencies
55
55
 
56
- The minimum requirement is Rails 3.0.3 and ruby. The gem has been tested with Rails 3.0.3 and above (including version 4.0.0). Previous versions of Rails are not compatible with the present version of bundler.
56
+ The minimum requirement is Rails 3.0.3 and ruby. The gem has been tested with Rails 3.0.3 and above (including versions 4.0.0 and 4.0.1). Previous versions of Rails are not compatible with the present version of bundler.
57
57
 
58
58
  The minimum version of ruby is MRI 1.9.1 or compatible, as the gem uses 1.9 syntax.
59
59
 
@@ -68,7 +68,6 @@ It has also been tested with PostgreSQL versions 8 and 9, but it may work also i
68
68
  - 1.9.3
69
69
  - 2.0.0
70
70
  - jruby
71
- - Rubinius
72
71
 
73
72
  The gem may work fine with other Ruby flavors/versions not listed above.
74
73
 
@@ -89,8 +88,8 @@ If you find any problem, please feel free to open an issue at the gem's reposito
89
88
  These files could be of particular interest:
90
89
 
91
90
  + [The Change Log](https://github.com/CarlosCD/cant_wait/blob/master/CHANGELOG.md)
92
- + [Test setup details](https://github.com/CarlosCD/cant_wait/blob/master/test/README.md)
93
- + [Gem signature verification](https://github.com/CarlosCD/cant_wait/blob/master/cert/README.md)
91
+ + [Test setup details](https://github.com/CarlosCD/cant_wait/blob/master/test/README.markdown)
92
+ + [Gem signature verification](https://github.com/CarlosCD/cant_wait/blob/master/cert/README.markdown)
94
93
 
95
94
 
96
95
  ## License
@@ -98,4 +97,4 @@ These files could be of particular interest:
98
97
  **cant_wait** is released under the [MIT License](http://opensource.org/licenses/MIT).
99
98
 
100
99
 
101
- August 2013
100
+ November 2013
data/Rakefile CHANGED
@@ -5,10 +5,9 @@ Dir[File.join('tasks', '*.rake')].each do |file_name|
5
5
  end
6
6
 
7
7
  task :default do
8
- puts 'No default task defined. Please take a look to test/Readme.md for details.'
9
- puts 'Here is what you can do:'
10
- puts
11
- system 'bundle exec rake -T'
8
+ puts 'It is assumed that the test environment is ready...'
9
+ puts 'If needed, please review test/README.markdown for details about the testing set up.'
10
+ Rake::Task['test:run'].invoke
12
11
  end
13
12
 
14
13
  private
@@ -67,4 +67,4 @@ If used this way, unless additional parameters are added by your particular setu
67
67
  Please be aware that the practice of signing gems is not followed as a standard by the whole development community, so you may find that many of the most popular ruby gems are not signed (bundler and rails are not signed at this moment). Therefore you may need to think about it, compromise, or carefully audit the code of the gems you try to install.
68
68
 
69
69
 
70
- August 2013
70
+ November 2013
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module CantWait
4
- VERSION = '0.0.4'
4
+ VERSION = '1.0.0'
5
5
  end
data/tasks/testing.rake CHANGED
@@ -1,16 +1,16 @@
1
1
  # Testing tasks:
2
2
  #
3
+ # rake test:all # Tests the gem's behavior, installing needed gems for the test apps first
3
4
  # rake test:bundle # Installs gems needed for the test apps (Bundle Install for each Rails app's Gemfile)
4
5
  # rake test:run # Tests the gem's behavior, using 5 test rails apps of different versions, and random timeouts
5
- # rake test:all # Tests the gem's behavior, installing needed gems for the test apps first
6
6
 
7
7
  namespace :test do
8
8
 
9
9
  TEST_RAILS_APP = [{ version: '3.0.3', rails_root: 'test/test_apps/Test_3_0_03'},
10
10
  { version: '3.0.20', rails_root: 'test/test_apps/Test_3_0_20'},
11
11
  { version: '3.1.12', rails_root: 'test/test_apps/Test_3_1_12'},
12
- { version: '3.2.14', rails_root: 'test/test_apps/Test_3_2_14'},
13
- { version: '4.0.0', rails_root: 'test/test_apps/Test_4_0_0' }]
12
+ { version: '3.2.15', rails_root: 'test/test_apps/Test_3_2_15'},
13
+ { version: '4.0.1', rails_root: 'test/test_apps/Test_4_0_1' }]
14
14
 
15
15
 
16
16
  # Argument (env.):
@@ -31,64 +31,6 @@ namespace :test do
31
31
  Rake::Task['test:run'].invoke
32
32
  end
33
33
 
34
- # Argument (env.):
35
- # VERBOSE=t Gives more information about what's going on
36
- # Other possible values (meaning the same): t, true, y, yes, on, ok
37
- # Default: no verbose (no flag)
38
- desc "Tests the gem's behavior, using 5 test rails apps of different versions, and random timeouts"
39
- task :run do
40
- # Verbose setting:
41
- verbose = boolean_env_param 'VERBOSE', 't', 'y', 'on', 'ok', 'yes', 'true'
42
- if verbose
43
- puts '------------------------------------------------'
44
- puts 'VERBOSE mode ON'
45
- print 'rvm setting (if rvm is being used): '
46
- system 'rvm current'
47
- puts "We'll run 5 times the test #1 (5 rails versions)"
48
- puts "Gem's ENV['BUNDLE_GEMFILE']='#{ENV['BUNDLE_GEMFILE']}'"
49
- end
50
- all_passing = true # Used to signal to travis-ci a build failure
51
- can_wait_bundle_gemfile = ENV['BUNDLE_GEMFILE']
52
- 5.times do |num|
53
- puts "====TESTING Rails version #{TEST_RAILS_APP[num][:version]}================="
54
- if (TEST_RAILS_APP[num][:version] >= '4') && (RUBY_VERSION < '1.9.3')
55
- puts 'At least Ruby 1.9.3 is required for rails 4 or above...'
56
- else
57
- # Uses Gemfile for the given version of rails
58
- gemfile_path = escape_filename_spaces TEST_RAILS_APP[num][:rails_root]
59
- gemfile = gemfile_path<<'/Gemfile'
60
- ENV['BUNDLE_GEMFILE'] = gemfile
61
- if verbose
62
- puts "Gemfile to be used in this case (ENV['BUNDLE_GEMFILE']): '#{ENV['BUNDLE_GEMFILE']}'"
63
- print 'echo $BUNDLE_GEMFILE: '
64
- system 'echo $BUNDLE_GEMFILE'
65
- end
66
- # We check the Gemfile and bundle install:
67
- puts 'bundle check' if verbose
68
- if system("bundle check --gemfile='#{gemfile_path}' > /dev/null")
69
- if verbose
70
- puts "The Gemfile's dependencies are satisfied"
71
- puts 'Testing....'
72
- end
73
- # Run several timeouts test for that version of rails (bundle exec...)
74
- # Only the last argument (V) is optional here:
75
- all_passing = false unless system "bundle exec ruby test/cant_wait_test.rb #{num} #{@gem_spec.version} #{'V' if verbose}"
76
- else
77
- puts ' bundle check and bundle failed! Check your rails test app Gemfile.'
78
- puts ' If there are missing gems, run rake test:bundle'
79
- all_passing = false
80
- end
81
- end
82
- end
83
- puts '------------------------------------------------'
84
- ENV['BUNDLE_GEMFILE'] = can_wait_bundle_gemfile
85
- if verbose
86
- puts "Finally set again the gem ENV['BUNDLE_GEMFILE'] as:"
87
- puts " '#{ENV['BUNDLE_GEMFILE']}'"
88
- end
89
- exit(1) unless all_passing # non zero meand build failure
90
- end
91
-
92
34
  # Arguments (env.):
93
35
  # VERBOSE=t It gives more information about what's going on
94
36
  # REBUILD=t It removes the Gemfile.lock, so it forces a clean bundle install
@@ -148,6 +90,64 @@ namespace :test do
148
90
  end
149
91
  end
150
92
 
93
+ # Argument (env.):
94
+ # VERBOSE=t Gives more information about what's going on
95
+ # Other possible values (meaning the same): t, true, y, yes, on, ok
96
+ # Default: no verbose (no flag)
97
+ desc "Tests the gem's behavior, using 5 test rails apps of different versions, and random timeouts"
98
+ task :run do
99
+ # Verbose setting:
100
+ verbose = boolean_env_param 'VERBOSE', 't', 'y', 'on', 'ok', 'yes', 'true'
101
+ if verbose
102
+ puts '------------------------------------------------'
103
+ puts 'VERBOSE mode ON'
104
+ print 'rvm setting (if rvm is being used): '
105
+ system 'rvm current'
106
+ puts "We'll run 5 times the test #1 (5 rails versions)"
107
+ puts "Gem's ENV['BUNDLE_GEMFILE']='#{ENV['BUNDLE_GEMFILE']}'"
108
+ end
109
+ all_passing = true # Used to signal to travis-ci a build failure
110
+ can_wait_bundle_gemfile = ENV['BUNDLE_GEMFILE']
111
+ 5.times do |num|
112
+ puts "====TESTING Rails version #{TEST_RAILS_APP[num][:version]}================="
113
+ if (TEST_RAILS_APP[num][:version] >= '4') && (RUBY_VERSION < '1.9.3')
114
+ puts 'At least Ruby 1.9.3 is required for rails 4 or above...'
115
+ else
116
+ # Uses Gemfile for the given version of rails
117
+ gemfile_path = escape_filename_spaces TEST_RAILS_APP[num][:rails_root]
118
+ gemfile = gemfile_path<<'/Gemfile'
119
+ ENV['BUNDLE_GEMFILE'] = gemfile
120
+ if verbose
121
+ puts "Gemfile to be used in this case (ENV['BUNDLE_GEMFILE']): '#{ENV['BUNDLE_GEMFILE']}'"
122
+ print 'echo $BUNDLE_GEMFILE: '
123
+ system 'echo $BUNDLE_GEMFILE'
124
+ end
125
+ # We check the Gemfile and bundle install:
126
+ puts 'bundle check' if verbose
127
+ if system("bundle check --gemfile='#{gemfile_path}' > /dev/null")
128
+ if verbose
129
+ puts "The Gemfile's dependencies are satisfied"
130
+ puts 'Testing....'
131
+ end
132
+ # Run several timeouts test for that version of rails (bundle exec...)
133
+ # Only the last argument (V) is optional here:
134
+ all_passing = false unless system "bundle exec ruby test/cant_wait_test.rb #{num} #{@gem_spec.version} #{'V' if verbose}"
135
+ else
136
+ puts ' bundle check and bundle failed! Check your rails test app Gemfile.'
137
+ puts ' If there are missing gems, run rake test:bundle'
138
+ all_passing = false
139
+ end
140
+ end
141
+ end
142
+ puts '------------------------------------------------'
143
+ ENV['BUNDLE_GEMFILE'] = can_wait_bundle_gemfile
144
+ if verbose
145
+ puts "Finally set again the gem ENV['BUNDLE_GEMFILE'] as:"
146
+ puts " '#{ENV['BUNDLE_GEMFILE']}'"
147
+ end
148
+ exit(1) unless all_passing # non zero meand build failure
149
+ end
150
+
151
151
  private
152
152
 
153
153
  def escape_filename_spaces(filename)
@@ -99,17 +99,12 @@ Check the .travis.yml file for details.
99
99
 
100
100
  * Versions of Ruby:
101
101
 
102
- 1.9.2-p320 (MRI's last patchlevel of 1.9.2) Linux and MacOS X
103
- 1.9.3-p327 (MRI) Linux
104
- 1.9.3-p429 (MRI) Linux and MacOS X
102
+ 1.9.2-p320 (MRI's last patchlevel of 1.9.2) Linux and Mac OS X
105
103
  1.9.3-p448 (MRI last patchlevel of 1.9.3) Linux and Mac OS X
106
- 2.0.0-p0 (MRI) Linux
107
- 2.0.0-p195 (MRI) Linux and MacOS X
108
104
  2.0.0-p247 (MRI last patchlevel of 2.0.0) Linux and Mac OS X
109
- jruby 1.7.3 (Java 1.7.0_15) Linux
110
- jruby 1.7.4 (Java 1.6.0_45) MacOS X
111
- jruby 1.7.4 (Java 1.7.0_21) Linux
112
- Rubinius 2.0.0.w30 (1.9.3) Linux
105
+ jruby 1.7.8 (Java 1.6.0) Mac OS X
106
+ jruby 1.7.8 (Java 1.7.0) Linux
107
+ Rubinius 2.0.0 (1.9.3-compatible) Linux
113
108
 
114
109
  It requires at least MRI 1.9.1 or compatible.
115
110
 
@@ -118,9 +113,8 @@ Check the .travis.yml file for details.
118
113
  Rails 3.0.3 First version using Bundler 1.3.5 (incompatible with Bundler 1.0.X)
119
114
  Rails 3.0.20 Last patchlevel of Rails 3.0 (at this moment)
120
115
  Rails 3.1.12 Last patchlevel of Rails 3.1
121
- Rails 3.2.13
122
- Rails 3.2.14 Last patchlevel of Rails 3.2 (many security fixes, last stable version)
123
- Rails 4.0.0 Last Release of Rails 4.0
116
+ Rails 3.2.15 Last patchlevel of Rails 3.2
117
+ Rails 4.0.1 Last Release of Rails 4.0
124
118
 
125
119
  * PostgreSQL versions 8.3.6 and 9.2.4.
126
120
 
@@ -138,4 +132,4 @@ Contributing:
138
132
  5. Create new Pull Request
139
133
 
140
134
 
141
- August 2013
135
+ November 2013
@@ -1,34 +1,45 @@
1
+ # Invocation from tasks/testing.rake:
2
+ # bundle exec ruby test/cant_wait_test.rb #{num} #{@gem_spec.version} #{'V' if verbose}
3
+ # Where the parameters are:
4
+ # 1: Number from 0 to 4. Index of the rails app (see TEST_RAILS_APP)
5
+ # 2: String with the Gem version, for example '1.0.0'.
6
+ # 3: V, for verbose (optional)
7
+ # Examples:
8
+ # bundle exec ruby test/cant_wait_test.rb 2 1.0.0
9
+ # bundle exec ruby test/cant_wait_test.rb 4 0.0.4 V
10
+
1
11
  require 'minitest/autorun'
2
12
  require 'minitest/growl_notify' if RUBY_PLATFORM =~ /darwin/i
3
13
 
4
14
  ENV['RAILS_ENV'] = 'test'
5
15
  $LOAD_PATH.unshift(File.dirname(__FILE__)) # We require the rails environment from here
6
16
 
7
- class CantWait1Test < MiniTest::Unit::TestCase
17
+ class CantWaitTest < MiniTest::Unit::TestCase
8
18
 
9
19
  TEST_RAILS_APP = [{ version: '3.0.3', rails_root: 'test_apps/Test_3_0_03'},
10
20
  { version: '3.0.20', rails_root: 'test_apps/Test_3_0_20'},
11
21
  { version: '3.1.12', rails_root: 'test_apps/Test_3_1_12'},
12
- { version: '3.2.14', rails_root: 'test_apps/Test_3_2_14'},
13
- { version: '4.0.0', rails_root: 'test_apps/Test_4_0_0' }]
22
+ { version: '3.2.15', rails_root: 'test_apps/Test_3_2_15'},
23
+ { version: '4.0.1', rails_root: 'test_apps/Test_4_0_1' }]
14
24
 
15
- # Set a random timeout and rails app to be tested
25
+ # Sets a random timeout and a Rails app to be tested
16
26
  def setup
17
- # To be run from rake test, or passing valid args:
18
- raise 'Wrong number of arguments for test' unless (2..3).include? ARGV.length
19
27
  # Arguments:
28
+ # To be run from rake test, passing valid args:
29
+ raise 'Wrong number of arguments for test' unless (2..3).include? ARGV.length
20
30
  rails_app_index = ARGV[0].to_i # Rails app index passed as an argument:
21
- @rails_app ||= TEST_RAILS_APP[rails_app_index]
22
31
  @gem_version = ARGV[1] # '0.0.1' or whatever
23
32
  @verbose = ARGV[2] == 'V'
24
- raise 'At least Ruby 1.9.3 is required for rails 4 or above' if (@rails_app[:version] >= '4') && (RUBY_VERSION < '1.9.3')
25
33
 
26
- # If app value given is not valid, we choose a random value:
34
+ # If app value given is not valid, we choose a random one:
27
35
  valid_range = (0..(TEST_RAILS_APP.length-1))
28
36
  rails_app_index = valid_range.include?(rails_app_index) ? rails_app_index : random_number(valid_range)
29
-
37
+ @rails_app ||= TEST_RAILS_APP[rails_app_index]
30
38
  puts "Rails version aimed at: #{@rails_app[:version]}" if @verbose
31
- # Choose one timeout option:
39
+
40
+ raise 'At least Ruby 1.9.3 is required for rails 4 or above' if (@rails_app[:version] >= '4') && (RUBY_VERSION < '1.9.3')
41
+
42
+ # Choose timeout option:
32
43
  test_chosen = random_number (1..4)
33
44
  case test_chosen
34
45
  when 1 then
@@ -49,33 +60,16 @@ class CantWait1Test < MiniTest::Unit::TestCase
49
60
  end
50
61
  end
51
62
 
52
- # 1. Create the config/database.yml with the given timeout
53
- # 2. Load Rails app
54
- # 3. Test that the timeout is the expected
55
63
  def test_in_rails_app
56
- # 1. Prepare config/database.yml
57
- database_file = File.join(File.dirname(__FILE__), '/database.yml')
58
- if File.exist?(database_file)
59
- database_config = File.read(database_file)
60
- else
61
- database_config = <<-DATABASE_SETTINGS
62
- test:
63
- adapter: postgresql
64
- host: localhost
65
- database: test
66
- username: tester
67
- password: secret
68
- DATABASE_SETTINGS
69
- end
70
- database_file = File.join(File.dirname(__FILE__), @rails_app[:rails_root]+'/config/database.yml')
71
- File.open(database_file, 'w') do |f|
72
- f << database_config
73
- f.write(" timeout: #{@timeout}\n") if @timeout
74
- end
64
+ # 1. Create config/database.yml with the given timeout:
65
+ build_database_yml
75
66
 
76
- # Load Rails app:
67
+ # 2. Load Rails app:
77
68
  require "#{@rails_app[:rails_root]}/config/environment.rb"
78
- # Testing we have the expected version of rails and ActiveRecord:
69
+
70
+ # 3. Misc. safety checks:
71
+
72
+ # Checking Rails and ActiveRecord's versions:
79
73
  assert_equal @rails_app[:version], Rails.version, "Rails.version should be #{@rails_app[:version]}, and it is #{Rails.version}"
80
74
  assert_equal @rails_app[:version], Rails::VERSION::STRING, "Rails being loaded, Rails::VERSION::STRING should be #{@rails_app[:version]}, and it is #{Rails::VERSION::STRING}"
81
75
  puts "Version of Rails loaded (Rails.version): #{Rails.version}" if @verbose
@@ -85,13 +79,12 @@ DATABASE_SETTINGS
85
79
  else
86
80
  assert_equal @rails_app[:version], ActiveRecord::VERSION::STRING, "ActiveRecord being used should be #{@rails_app[:version]}, and it is #{ActiveRecord::VERSION::STRING}"
87
81
  end
88
- # Right gemfile:
89
- puts "ENV['BUNDLE_GEMFILE'] = '#{ENV['BUNDLE_GEMFILE']}" if @verbose
90
- # assert_equal ENV['BUNDLE_GEMFILE'], "test/#{@rails_app[:rails_root]}/Gemfile"
91
- # We are testing the right version on cant_wait
82
+
83
+ # Are we testing the right version on cant_wait?
84
+ puts "ENV['BUNDLE_GEMFILE'] = '#{ENV['BUNDLE_GEMFILE']}" if @verbose # Gemfile used by Bundler
92
85
  assert_equal CantWait::VERSION, @gem_version, "cant_wait should be #{@gem_version}, and it is #{CantWait::VERSION}"
93
86
 
94
- # Test that the timeout is correct
87
+ # 4. Test that the timeout is the expected
95
88
  assert_equal @expected_result, statement_timeout
96
89
  end
97
90
 
@@ -101,6 +94,34 @@ DATABASE_SETTINGS
101
94
  collection.to_a.sample if collection.respond_to? :to_a
102
95
  end
103
96
 
97
+ def build_database_yml
98
+ write_database_yml database_yml_contents
99
+ end
100
+
101
+ def database_yml_contents
102
+ database_file = File.join(File.dirname(__FILE__), '/database.yml')
103
+ if File.exist?(database_file)
104
+ File.read(database_file)
105
+ else
106
+ <<-DATABASE_SETTINGS
107
+ test:
108
+ adapter: postgresql
109
+ host: localhost
110
+ database: test
111
+ username: tester
112
+ password: secret
113
+ DATABASE_SETTINGS
114
+ end
115
+ end
116
+
117
+ def write_database_yml(content = '')
118
+ database_file = File.join(File.dirname(__FILE__), @rails_app[:rails_root]+'/config/database.yml')
119
+ File.open(database_file, 'w') do |f|
120
+ f << content.to_s
121
+ f.write(" timeout: #{@timeout}\n") if @timeout
122
+ end
123
+ end
124
+
104
125
  def statement_timeout
105
126
  statement_timeout_string = ActiveRecord::Base.connection.select_all('show statement_timeout')[0]['statement_timeout']
106
127
  decifer_postgres_fancy_timeout statement_timeout_string
@@ -1,17 +1,40 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '3.2.14'
3
+ gem 'rails', '3.2.15'
4
+
5
+ # Bundle edge Rails instead:
6
+ # gem 'rails', :git => 'git://github.com/rails/rails.git'
7
+
4
8
 
5
9
  # Gems used only for assets and not required
6
10
  # in production environments by default.
7
11
  group :assets do
8
12
  gem 'sass-rails', '~> 3.2.3'
9
13
  gem 'coffee-rails', '~> 3.2.1'
10
- gem 'uglifier', '>= 1.0.3'
14
+
15
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
16
+ # gem 'therubyracer', :platforms => :ruby
17
+
18
+ gem 'uglifier', '>= 1.0.3'
11
19
  end
12
20
 
13
21
  gem 'jquery-rails'
14
22
 
23
+ # To use ActiveModel has_secure_password
24
+ # gem 'bcrypt-ruby', '~> 3.0.0'
25
+
26
+ # To use Jbuilder templates for JSON
27
+ # gem 'jbuilder'
28
+
29
+ # Use unicorn as the app server
30
+ # gem 'unicorn'
31
+
32
+ # Deploy with Capistrano
33
+ # gem 'capistrano'
34
+
35
+ # To use debugger
36
+ # gem 'debugger'
37
+
15
38
  #-- Special additions-----------------
16
39
  # PostgreSQL as the database for ActiveRecord
17
40
  if RUBY_ENGINE == 'jruby' && RUBY_PLATFORM == 'java'
@@ -4,4 +4,4 @@
4
4
 
5
5
  require File.expand_path('../config/application', __FILE__)
6
6
 
7
- Test3214::Application.load_tasks
7
+ Test3215::Application.load_tasks
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>Test3214</title>
4
+ <title>Test3215</title>
5
5
  <%= stylesheet_link_tag "application", :media => "all" %>
6
6
  <%= javascript_include_tag "application" %>
7
7
  <%= csrf_meta_tags %>
@@ -9,7 +9,7 @@ if defined?(Bundler)
9
9
  # Bundler.require(:default, :assets, Rails.env)
10
10
  end
11
11
 
12
- module Test3214
12
+ module Test3215
13
13
  class Application < Rails::Application
14
14
  # Settings in config/environments/* take precedence over those specified here.
15
15
  # Application configuration should go into files in config/initializers
@@ -2,4 +2,4 @@
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
4
  # Initialize the rails application
5
- Test3214::Application.initialize!
5
+ Test3215::Application.initialize!
@@ -1,4 +1,4 @@
1
- Test3214::Application.configure do
1
+ Test3215::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb
3
3
 
4
4
  # In the development environment your application's code is reloaded on
@@ -1,4 +1,4 @@
1
- Test3214::Application.configure do
1
+ Test3215::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb
3
3
 
4
4
  # Code is not reloaded between requests
@@ -1,4 +1,4 @@
1
- Test3214::Application.configure do
1
+ Test3215::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb
3
3
 
4
4
  # The test environment is used exclusively to run your application's
@@ -4,4 +4,4 @@
4
4
  # If you change this key, all old signed cookies will become invalid!
5
5
  # Make sure the secret is at least 30 characters and all random,
6
6
  # no regular words or you'll be exposed to dictionary attacks.
7
- Test3214::Application.config.secret_token = '49219137772173a83c7a25c691aa4de6571a40443b47e9da5c04d448dc8eb7ab1ab26d3e60fd713997e992051eff9f867b18adcd9f0fd819270dea8f26376700'
7
+ Test3215::Application.config.secret_token = '191a6d6583b35efd1f9243f9a14bab79306ee7675372128964e1eccce12132066d9b644fe5ebe4ed6016f4a435242d61df85b98a8959eb3ae14de0365b94a73a'
@@ -1,8 +1,8 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Test3214::Application.config.session_store :cookie_store, key: '_Test_3_2_14_session'
3
+ Test3215::Application.config.session_store :cookie_store, key: '_Test_3_2_15_session'
4
4
 
5
5
  # Use the database for sessions instead of the cookie-based default,
6
6
  # which shouldn't be used to store highly confidential information
7
7
  # (create the session table with "rails generate session_migration")
8
- # Test3214::Application.config.session_store :active_record_store
8
+ # Test3215::Application.config.session_store :active_record_store
@@ -1,4 +1,4 @@
1
- Test3214::Application.routes.draw do
1
+ Test3215::Application.routes.draw do
2
2
  # The priority is based upon order of creation:
3
3
  # first created -> highest priority.
4
4
 
@@ -1,4 +1,4 @@
1
1
  # This file is used by Rack-based servers to start the application.
2
2
 
3
3
  require ::File.expand_path('../config/environment', __FILE__)
4
- run Test3214::Application
4
+ run Test3215::Application