mcmire-shoulda-matchers 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.travis.yml +32 -0
- data/.yardopts +7 -0
- data/Appraisals +45 -0
- data/CONTRIBUTING.md +41 -0
- data/Gemfile +31 -0
- data/Gemfile.lock +166 -0
- data/MIT-LICENSE +22 -0
- data/NEWS.md +299 -0
- data/README.md +163 -0
- data/Rakefile +116 -0
- data/doc_config/gh-pages/index.html.erb +9 -0
- data/doc_config/yard/setup.rb +22 -0
- data/doc_config/yard/templates/default/fulldoc/html/css/bootstrap.css +5967 -0
- data/doc_config/yard/templates/default/fulldoc/html/css/full_list.css +12 -0
- data/doc_config/yard/templates/default/fulldoc/html/css/global.css +45 -0
- data/doc_config/yard/templates/default/fulldoc/html/css/solarized.css +69 -0
- data/doc_config/yard/templates/default/fulldoc/html/css/style.css +283 -0
- data/doc_config/yard/templates/default/fulldoc/html/full_list.erb +32 -0
- data/doc_config/yard/templates/default/fulldoc/html/full_list_class.erb +1 -0
- data/doc_config/yard/templates/default/fulldoc/html/full_list_method.erb +8 -0
- data/doc_config/yard/templates/default/fulldoc/html/js/app.js +300 -0
- data/doc_config/yard/templates/default/fulldoc/html/js/full_list.js +1 -0
- data/doc_config/yard/templates/default/fulldoc/html/js/jquery.stickyheaders.js +289 -0
- data/doc_config/yard/templates/default/fulldoc/html/js/underscore.min.js +6 -0
- data/doc_config/yard/templates/default/fulldoc/html/setup.rb +8 -0
- data/doc_config/yard/templates/default/layout/html/breadcrumb.erb +14 -0
- data/doc_config/yard/templates/default/layout/html/fonts.erb +1 -0
- data/doc_config/yard/templates/default/layout/html/layout.erb +23 -0
- data/doc_config/yard/templates/default/layout/html/search.erb +13 -0
- data/doc_config/yard/templates/default/layout/html/setup.rb +8 -0
- data/doc_config/yard/templates/default/method_details/html/source.erb +10 -0
- data/doc_config/yard/templates/default/module/html/box_info.erb +31 -0
- data/features/rails_integration.feature +113 -0
- data/features/step_definitions/rails_steps.rb +162 -0
- data/features/support/env.rb +5 -0
- data/gemfiles/3.0.gemfile +24 -0
- data/gemfiles/3.0.gemfile.lock +150 -0
- data/gemfiles/3.1.gemfile +27 -0
- data/gemfiles/3.1.gemfile.lock +173 -0
- data/gemfiles/3.2.gemfile +27 -0
- data/gemfiles/3.2.gemfile.lock +171 -0
- data/gemfiles/4.0.0.gemfile +28 -0
- data/gemfiles/4.0.0.gemfile.lock +172 -0
- data/gemfiles/4.0.1.gemfile +28 -0
- data/gemfiles/4.0.1.gemfile.lock +172 -0
- data/lib/shoulda-matchers.rb +1 -0
- data/lib/shoulda/matchers.rb +11 -0
- data/lib/shoulda/matchers/action_controller.rb +17 -0
- data/lib/shoulda/matchers/action_controller/filter_param_matcher.rb +64 -0
- data/lib/shoulda/matchers/action_controller/redirect_to_matcher.rb +97 -0
- data/lib/shoulda/matchers/action_controller/render_template_matcher.rb +81 -0
- data/lib/shoulda/matchers/action_controller/render_with_layout_matcher.rb +117 -0
- data/lib/shoulda/matchers/action_controller/rescue_from_matcher.rb +114 -0
- data/lib/shoulda/matchers/action_controller/respond_with_matcher.rb +154 -0
- data/lib/shoulda/matchers/action_controller/route_matcher.rb +116 -0
- data/lib/shoulda/matchers/action_controller/route_params.rb +48 -0
- data/lib/shoulda/matchers/action_controller/set_session_matcher.rb +164 -0
- data/lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb +296 -0
- data/lib/shoulda/matchers/active_model.rb +30 -0
- data/lib/shoulda/matchers/active_model/allow_mass_assignment_of_matcher.rb +167 -0
- data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +314 -0
- data/lib/shoulda/matchers/active_model/disallow_value_matcher.rb +46 -0
- data/lib/shoulda/matchers/active_model/ensure_exclusion_of_matcher.rb +160 -0
- data/lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb +417 -0
- data/lib/shoulda/matchers/active_model/ensure_length_of_matcher.rb +337 -0
- data/lib/shoulda/matchers/active_model/errors.rb +10 -0
- data/lib/shoulda/matchers/active_model/exception_message_finder.rb +58 -0
- data/lib/shoulda/matchers/active_model/have_secure_password_matcher.rb +92 -0
- data/lib/shoulda/matchers/active_model/helpers.rb +46 -0
- data/lib/shoulda/matchers/active_model/numericality_matchers.rb +9 -0
- data/lib/shoulda/matchers/active_model/numericality_matchers/comparison_matcher.rb +75 -0
- data/lib/shoulda/matchers/active_model/numericality_matchers/even_number_matcher.rb +27 -0
- data/lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb +41 -0
- data/lib/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher.rb +27 -0
- data/lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb +26 -0
- data/lib/shoulda/matchers/active_model/validate_absence_of_matcher.rb +112 -0
- data/lib/shoulda/matchers/active_model/validate_acceptance_of_matcher.rb +77 -0
- data/lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb +121 -0
- data/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb +380 -0
- data/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb +89 -0
- data/lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb +372 -0
- data/lib/shoulda/matchers/active_model/validation_matcher.rb +97 -0
- data/lib/shoulda/matchers/active_model/validation_message_finder.rb +69 -0
- data/lib/shoulda/matchers/active_record.rb +22 -0
- data/lib/shoulda/matchers/active_record/accept_nested_attributes_for_matcher.rb +204 -0
- data/lib/shoulda/matchers/active_record/association_matcher.rb +901 -0
- data/lib/shoulda/matchers/active_record/association_matchers.rb +9 -0
- data/lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb +41 -0
- data/lib/shoulda/matchers/active_record/association_matchers/dependent_matcher.rb +41 -0
- data/lib/shoulda/matchers/active_record/association_matchers/model_reflection.rb +81 -0
- data/lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb +65 -0
- data/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb +94 -0
- data/lib/shoulda/matchers/active_record/association_matchers/order_matcher.rb +41 -0
- data/lib/shoulda/matchers/active_record/association_matchers/source_matcher.rb +41 -0
- data/lib/shoulda/matchers/active_record/association_matchers/through_matcher.rb +63 -0
- data/lib/shoulda/matchers/active_record/have_db_column_matcher.rb +261 -0
- data/lib/shoulda/matchers/active_record/have_db_index_matcher.rb +149 -0
- data/lib/shoulda/matchers/active_record/have_readonly_attribute_matcher.rb +72 -0
- data/lib/shoulda/matchers/active_record/serialize_matcher.rb +181 -0
- data/lib/shoulda/matchers/assertion_error.rb +19 -0
- data/lib/shoulda/matchers/error.rb +6 -0
- data/lib/shoulda/matchers/integrations/rspec.rb +20 -0
- data/lib/shoulda/matchers/integrations/test_unit.rb +30 -0
- data/lib/shoulda/matchers/rails_shim.rb +50 -0
- data/lib/shoulda/matchers/version.rb +6 -0
- data/lib/shoulda/matchers/warn.rb +8 -0
- data/shoulda-matchers.gemspec +23 -0
- data/spec/shoulda/matchers/action_controller/filter_param_matcher_spec.rb +22 -0
- data/spec/shoulda/matchers/action_controller/redirect_to_matcher_spec.rb +42 -0
- data/spec/shoulda/matchers/action_controller/render_template_matcher_spec.rb +78 -0
- data/spec/shoulda/matchers/action_controller/render_with_layout_matcher_spec.rb +63 -0
- data/spec/shoulda/matchers/action_controller/rescue_from_matcher_spec.rb +63 -0
- data/spec/shoulda/matchers/action_controller/respond_with_matcher_spec.rb +31 -0
- data/spec/shoulda/matchers/action_controller/route_matcher_spec.rb +70 -0
- data/spec/shoulda/matchers/action_controller/route_params_spec.rb +30 -0
- data/spec/shoulda/matchers/action_controller/set_session_matcher_spec.rb +51 -0
- data/spec/shoulda/matchers/action_controller/set_the_flash_matcher_spec.rb +153 -0
- data/spec/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb +111 -0
- data/spec/shoulda/matchers/active_model/allow_value_matcher_spec.rb +170 -0
- data/spec/shoulda/matchers/active_model/disallow_value_matcher_spec.rb +81 -0
- data/spec/shoulda/matchers/active_model/ensure_exclusion_of_matcher_spec.rb +95 -0
- data/spec/shoulda/matchers/active_model/ensure_inclusion_of_matcher_spec.rb +320 -0
- data/spec/shoulda/matchers/active_model/ensure_length_of_matcher_spec.rb +166 -0
- data/spec/shoulda/matchers/active_model/exception_message_finder_spec.rb +111 -0
- data/spec/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb +20 -0
- data/spec/shoulda/matchers/active_model/helpers_spec.rb +158 -0
- data/spec/shoulda/matchers/active_model/numericality_matchers/comparison_matcher_spec.rb +169 -0
- data/spec/shoulda/matchers/active_model/numericality_matchers/even_number_matcher_spec.rb +59 -0
- data/spec/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher_spec.rb +59 -0
- data/spec/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher_spec.rb +57 -0
- data/spec/shoulda/matchers/active_model/validate_absence_of_matcher_spec.rb +139 -0
- data/spec/shoulda/matchers/active_model/validate_acceptance_of_matcher_spec.rb +41 -0
- data/spec/shoulda/matchers/active_model/validate_confirmation_of_matcher_spec.rb +47 -0
- data/spec/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb +331 -0
- data/spec/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb +180 -0
- data/spec/shoulda/matchers/active_model/validate_uniqueness_of_matcher_spec.rb +398 -0
- data/spec/shoulda/matchers/active_model/validation_message_finder_spec.rb +127 -0
- data/spec/shoulda/matchers/active_record/accept_nested_attributes_for_matcher_spec.rb +107 -0
- data/spec/shoulda/matchers/active_record/association_matcher_spec.rb +860 -0
- data/spec/shoulda/matchers/active_record/association_matchers/model_reflection_spec.rb +247 -0
- data/spec/shoulda/matchers/active_record/have_db_column_matcher_spec.rb +111 -0
- data/spec/shoulda/matchers/active_record/have_db_index_matcher_spec.rb +78 -0
- data/spec/shoulda/matchers/active_record/have_readonly_attributes_matcher_spec.rb +41 -0
- data/spec/shoulda/matchers/active_record/serialize_matcher_spec.rb +86 -0
- data/spec/spec_helper.rb +26 -0
- data/spec/support/active_model_versions.rb +13 -0
- data/spec/support/active_resource_builder.rb +29 -0
- data/spec/support/activemodel_helpers.rb +19 -0
- data/spec/support/capture_helpers.rb +19 -0
- data/spec/support/class_builder.rb +42 -0
- data/spec/support/controller_builder.rb +74 -0
- data/spec/support/fail_with_message_including_matcher.rb +33 -0
- data/spec/support/fail_with_message_matcher.rb +32 -0
- data/spec/support/i18n_faker.rb +10 -0
- data/spec/support/mailer_builder.rb +10 -0
- data/spec/support/model_builder.rb +81 -0
- data/spec/support/rails_versions.rb +18 -0
- data/spec/support/shared_examples/numerical_submatcher.rb +19 -0
- data/spec/support/shared_examples/numerical_type_submatcher.rb +17 -0
- data/spec/support/test_application.rb +120 -0
- data/yard.watchr +5 -0
- metadata +281 -0
@@ -0,0 +1,6 @@
|
|
1
|
+
// Underscore.js 1.5.2
|
2
|
+
// http://underscorejs.org
|
3
|
+
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
4
|
+
// Underscore may be freely distributed under the MIT license.
|
5
|
+
(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?(this._wrapped=n,void 0):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.5.2";var A=j.each=j.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var E="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(E);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(E);return r},j.find=j.detect=function(n,t,r){var e;return O(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var O=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:O(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,function(n){return n[t]})},j.where=function(n,t,r){return j.isEmpty(t)?r?void 0:[]:j[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},j.findWhere=function(n,t){return j.where(n,t,!0)},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);if(!t&&j.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>e.computed&&(e={value:n,computed:a})}),e.value},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);if(!t&&j.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a<e.computed&&(e={value:n,computed:a})}),e.value},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return arguments.length<2||r?n[j.random(n.length-1)]:j.shuffle(n).slice(0,Math.max(0,t))};var k=function(n){return j.isFunction(n)?n:function(t){return t[n]}};j.sortBy=function(n,t,r){var e=k(t);return j.pluck(j.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={},i=null==r?j.identity:k(r);return A(t,function(r,a){var o=i.call(e,r,a,t);n(u,o,r)}),u}};j.groupBy=F(function(n,t,r){(j.has(n,t)?n[t]:n[t]=[]).push(r)}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=null==r?j.identity:k(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])<u?i=o+1:a=o}return i},j.toArray=function(n){return n?j.isArray(n)?o.call(n):n.length===+n.length?j.map(n,j.identity):j.values(n):[]},j.size=function(n){return null==n?0:n.length===+n.length?n.length:j.keys(n).length},j.first=j.head=j.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.indexOf(t,n)>=0})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},j.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},j.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var c=function(){o=r.leading===!1?0:new Date,a=null,i=n.apply(e,u)};return function(){var l=new Date;o||r.leading!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u)):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o;return function(){i=this,u=arguments,a=new Date;var c=function(){var l=new Date-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u)))},l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u)),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=w||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var I={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};I.unescape=j.invert(I.escape);var T={escape:new RegExp("["+j.keys(I.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(I.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(T[n],function(t){return I[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);
|
6
|
+
//# sourceMappingURL=underscore-min.map
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<div id="menu">
|
2
|
+
<% unless @file && @file.filename == 'README.md' %>
|
3
|
+
<span class="title">
|
4
|
+
<%= linkify('file:README.md', 'Home') %>
|
5
|
+
</span> »
|
6
|
+
<% end %>
|
7
|
+
<% if @contents || @file %>
|
8
|
+
<span class="title"><%= @breadcrumb_title %></span>
|
9
|
+
<% elsif object.is_a?(CodeObjects::Base) %>
|
10
|
+
<%= @breadcrumb.map {|obj| "<span class='title'>" + linkify(obj, obj.name) + "</span>" }.join(" » ") %>
|
11
|
+
<%= @breadcrumb.size > 0 ? " » " : "" %>
|
12
|
+
<span class="title"><%= object.root? ? "Top Level Namespace" : object.name(true) %></span>
|
13
|
+
<% end %>
|
14
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<!-- Fonts go here -->
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<%= erb(:headers) %>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
<div id="header">
|
9
|
+
<div class="header-row">
|
10
|
+
<%= erb(:breadcrumb) %>
|
11
|
+
<%= erb(:search) %>
|
12
|
+
<div class="clear"></div>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div id="main">
|
17
|
+
<div id="content"><%= yieldall %></div>
|
18
|
+
|
19
|
+
<%= erb(:footer) %>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
</body>
|
23
|
+
</html>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div id="search" class="js-search">
|
2
|
+
<ul>
|
3
|
+
<% menu_lists.each do |field| %>
|
4
|
+
<li>
|
5
|
+
<a href="<%= url_for_list(field[:type]) %>">
|
6
|
+
<%= field[:search_title] %>
|
7
|
+
</a>
|
8
|
+
</li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
|
12
|
+
<iframe id="search_frame" class="js-search-frame"></iframe>
|
13
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<table class="source_code">
|
2
|
+
<tr>
|
3
|
+
<td class="lines">
|
4
|
+
<pre><%= "\n\n\n" %><%= h format_lines(object) %></pre>
|
5
|
+
</td>
|
6
|
+
<td class="code">
|
7
|
+
<pre><span class="info file"># File '<%= h object.file %>'<% if object.line %>, line <%= object.line %><% end %></span><%= "\n\n" %><%= html_syntax_highlight object.source %></pre>
|
8
|
+
</td>
|
9
|
+
</tr>
|
10
|
+
</table>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<% n = 1 %>
|
2
|
+
<dl class="box">
|
3
|
+
<% if CodeObjects::ClassObject === object && object.superclass %>
|
4
|
+
<dt class="r<%=n%>">Inherits:</dt>
|
5
|
+
<dd class="r<%=n%>">
|
6
|
+
<span class="inheritName"><%= linkify object.superclass %></span>
|
7
|
+
<% if object.superclass.name != :BasicObject %>
|
8
|
+
<ul class="fullTree">
|
9
|
+
<li><%= linkify P(:Object) %></li>
|
10
|
+
<% object.inheritance_tree.reverse.each_with_index do |obj, i| %>
|
11
|
+
<li class="next"><%= obj == object ? obj.path : linkify(obj) %></li>
|
12
|
+
<% end %>
|
13
|
+
</ul>
|
14
|
+
<a href="#" class="inheritanceTree">show all</a>
|
15
|
+
<% end %>
|
16
|
+
</dd>
|
17
|
+
<% n = 2 %>
|
18
|
+
<% end %>
|
19
|
+
<% [[:class, "Extended by"], [:instance, "Includes"]].each do |scope, name| %>
|
20
|
+
<% if (mix = run_verifier(object.mixins(scope))).size > 0 %>
|
21
|
+
<dt class="r<%=n%>"><%= name %>:</dt>
|
22
|
+
<dd class="r<%=n%>"><%= mix.sort_by {|o| o.path }.map {|o| linkify(o) }.join(", ") %></dd>
|
23
|
+
<% n = n == 2 ? 1 : 2 %>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
<% if (mixed_into = mixed_into(object)).size > 0 %>
|
27
|
+
<dt class="r<%=n%>">Included in:</dt>
|
28
|
+
<dd class="r<%=n%>"><%= mixed_into.sort_by {|o| o.path }.map {|o| linkify(o) }.join(", ") %></dd>
|
29
|
+
<% n = n == 2 ? 1 : 2 %>
|
30
|
+
<% end %>
|
31
|
+
</dl>
|
@@ -0,0 +1,113 @@
|
|
1
|
+
Feature: integrate with Rails
|
2
|
+
|
3
|
+
Background:
|
4
|
+
When I generate a new rails application
|
5
|
+
And I write to "db/migrate/1_create_users.rb" with:
|
6
|
+
"""
|
7
|
+
class CreateUsers < ActiveRecord::Migration
|
8
|
+
def self.up
|
9
|
+
create_table :users do |t|
|
10
|
+
t.string :name
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
"""
|
15
|
+
When I successfully run `bundle exec rake db:migrate --trace`
|
16
|
+
And I write to "app/models/user.rb" with:
|
17
|
+
"""
|
18
|
+
class User < ActiveRecord::Base
|
19
|
+
validates_presence_of :name
|
20
|
+
end
|
21
|
+
"""
|
22
|
+
When I write to "app/controllers/examples_controller.rb" with:
|
23
|
+
"""
|
24
|
+
class ExamplesController < ApplicationController
|
25
|
+
def show
|
26
|
+
@example = 'hello'
|
27
|
+
render :nothing => true
|
28
|
+
end
|
29
|
+
end
|
30
|
+
"""
|
31
|
+
When I configure a wildcard route
|
32
|
+
|
33
|
+
Scenario: generate a rails application and use matchers in Test::Unit
|
34
|
+
When I configure the application to use shoulda-context
|
35
|
+
And I configure the application to use "shoulda-matchers" from this project
|
36
|
+
And I write to "test/unit/user_test.rb" with:
|
37
|
+
"""
|
38
|
+
require 'test_helper'
|
39
|
+
|
40
|
+
class UserTest < ActiveSupport::TestCase
|
41
|
+
should validate_presence_of(:name)
|
42
|
+
end
|
43
|
+
"""
|
44
|
+
When I write to "test/functional/examples_controller_test.rb" with:
|
45
|
+
"""
|
46
|
+
require 'test_helper'
|
47
|
+
|
48
|
+
class ExamplesControllerTest < ActionController::TestCase
|
49
|
+
def setup
|
50
|
+
get :show
|
51
|
+
end
|
52
|
+
|
53
|
+
should respond_with(:success)
|
54
|
+
end
|
55
|
+
"""
|
56
|
+
When I set the "TESTOPTS" environment variable to "-v"
|
57
|
+
When I successfully run `bundle exec rake test --trace`
|
58
|
+
Then the output should indicate that 1 unit and 1 functional test were run
|
59
|
+
And the output should contain "User should require name to be set"
|
60
|
+
And the output should contain "should respond with 200"
|
61
|
+
|
62
|
+
Scenario: generate a rails application and use matchers in Rspec
|
63
|
+
When I configure the application to use rspec-rails
|
64
|
+
And I configure the application to use "shoulda-matchers" from this project
|
65
|
+
And I run the rspec generator
|
66
|
+
And I write to "spec/models/user_spec.rb" with:
|
67
|
+
"""
|
68
|
+
require 'spec_helper'
|
69
|
+
|
70
|
+
describe User do
|
71
|
+
it { should validate_presence_of(:name) }
|
72
|
+
end
|
73
|
+
"""
|
74
|
+
When I write to "spec/controllers/examples_controller_spec.rb" with:
|
75
|
+
"""
|
76
|
+
require 'spec_helper'
|
77
|
+
|
78
|
+
describe ExamplesController, "show" do
|
79
|
+
before { get :show }
|
80
|
+
it { should respond_with(:success) }
|
81
|
+
end
|
82
|
+
"""
|
83
|
+
When I successfully run `bundle exec rake spec SPEC_OPTS=-fs --trace`
|
84
|
+
Then the output should contain "2 examples, 0 failures"
|
85
|
+
And the output should contain "should require name to be set"
|
86
|
+
And the output should contain "should respond with 200"
|
87
|
+
|
88
|
+
Scenario: generate a Rails application that mixes Rspec and Test::Unit
|
89
|
+
When I configure the application to use rspec-rails in test and development
|
90
|
+
And I configure the application to use "shoulda-matchers" from this project in test and development
|
91
|
+
And I run the rspec generator
|
92
|
+
And I write to "spec/models/user_spec.rb" with:
|
93
|
+
"""
|
94
|
+
require 'spec_helper'
|
95
|
+
|
96
|
+
describe User do
|
97
|
+
it { should validate_presence_of(:name) }
|
98
|
+
end
|
99
|
+
"""
|
100
|
+
When I write to "test/functional/examples_controller_test.rb" with:
|
101
|
+
"""
|
102
|
+
require 'test_helper'
|
103
|
+
|
104
|
+
class ExamplesControllerTest < ActionController::TestCase
|
105
|
+
test 'responds successfully' do
|
106
|
+
get :show
|
107
|
+
assert respond_with(:success)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
"""
|
111
|
+
When I successfully run `bundle exec rake spec test:functionals SPEC_OPTS=-fs --trace`
|
112
|
+
Then the output should contain "1 example, 0 failures"
|
113
|
+
Then the output should indicate that 1 test was run
|
@@ -0,0 +1,162 @@
|
|
1
|
+
PROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')).freeze
|
2
|
+
APP_NAME = 'testapp'.freeze
|
3
|
+
|
4
|
+
BUNDLE_ENV_VARS = %w(RUBYOPT BUNDLE_PATH BUNDLE_BIN_PATH BUNDLE_GEMFILE)
|
5
|
+
ORIGINAL_BUNDLE_VARS = Hash[ENV.select{ |key,value| BUNDLE_ENV_VARS.include?(key) }]
|
6
|
+
|
7
|
+
Before do
|
8
|
+
ENV['BUNDLE_GEMFILE'] = File.join(Dir.pwd, ENV['BUNDLE_GEMFILE']) unless ENV['BUNDLE_GEMFILE'].start_with?(Dir.pwd)
|
9
|
+
end
|
10
|
+
|
11
|
+
After do
|
12
|
+
ORIGINAL_BUNDLE_VARS.each_pair do |key, value|
|
13
|
+
ENV[key] = value
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
When 'I generate a new rails application' do
|
18
|
+
steps %{
|
19
|
+
When I run `bundle exec rails new #{APP_NAME} --skip-bundle`
|
20
|
+
And I cd to "#{APP_NAME}"
|
21
|
+
And I comment out the gem "turn" from the Gemfile
|
22
|
+
And I comment out the gem "coffee-rails" from the Gemfile
|
23
|
+
And I comment out the gem "uglifier" from the Gemfile
|
24
|
+
And I reset Bundler environment variables
|
25
|
+
And I set the "BUNDLE_GEMFILE" environment variable to "Gemfile"
|
26
|
+
And I install gems
|
27
|
+
}
|
28
|
+
|
29
|
+
if RUBY_VERSION >= '1.9.3'
|
30
|
+
append_to_gemfile %(gem 'rake', '~> 0.9')
|
31
|
+
step %(I successfully run `bundle update rake`)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
When /^I configure the application to use "([^\"]+)" from this project$/ do |name|
|
36
|
+
append_to_gemfile "gem '#{name}', path: '#{PROJECT_ROOT}'"
|
37
|
+
steps %{And I install gems}
|
38
|
+
end
|
39
|
+
|
40
|
+
When /^I configure the application to use "([^\"]+)" from this project in test and development$/ do |name|
|
41
|
+
append_to_gemfile <<-GEMFILE
|
42
|
+
group :test, :development do
|
43
|
+
gem '#{name}', path: '#{PROJECT_ROOT}'
|
44
|
+
end
|
45
|
+
GEMFILE
|
46
|
+
steps %{And I install gems}
|
47
|
+
end
|
48
|
+
|
49
|
+
When 'I run the rspec generator' do
|
50
|
+
steps %{
|
51
|
+
When I successfully run `rails generate rspec:install`
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
When 'I configure the application to use rspec-rails' do
|
56
|
+
append_to_gemfile %q(gem 'rspec-rails', '~> 2.13')
|
57
|
+
steps %{And I install gems}
|
58
|
+
end
|
59
|
+
|
60
|
+
When 'I configure the application to use rspec-rails in test and development' do
|
61
|
+
append_to_gemfile <<-GEMFILE
|
62
|
+
group :test, :development do
|
63
|
+
gem 'rspec-rails', '~> 2.13'
|
64
|
+
end
|
65
|
+
GEMFILE
|
66
|
+
steps %{And I install gems}
|
67
|
+
end
|
68
|
+
|
69
|
+
When 'I configure the application to use shoulda-context' do
|
70
|
+
append_to_gemfile %q(gem 'shoulda-context', '~> 1.0')
|
71
|
+
steps %{And I install gems}
|
72
|
+
end
|
73
|
+
|
74
|
+
When /^I set the "([^"]*)" environment variable to "([^"]*)"$/ do |key, value|
|
75
|
+
ENV[key] = value
|
76
|
+
end
|
77
|
+
|
78
|
+
When 'I configure a wildcard route' do
|
79
|
+
steps %{
|
80
|
+
When I write to "config/routes.rb" with:
|
81
|
+
"""
|
82
|
+
Rails.application.routes.draw do
|
83
|
+
get ':controller(/:action(/:id(.:format)))'
|
84
|
+
end
|
85
|
+
"""
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
When 'I append gems from Appraisal Gemfile' do
|
90
|
+
File.read(ENV['BUNDLE_GEMFILE']).split("\n").each do |line|
|
91
|
+
if line =~ /^gem "(?!rails|appraisal)/
|
92
|
+
append_to_gemfile line.strip
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
When 'I reset Bundler environment variables' do
|
98
|
+
BUNDLE_ENV_VARS.each do |key|
|
99
|
+
ENV[key] = nil
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
When /^I comment out the gem "([^"]*)" from the Gemfile$/ do |gemname|
|
104
|
+
comment_out_gem_in_gemfile(gemname)
|
105
|
+
end
|
106
|
+
|
107
|
+
When /^I install gems$/ do
|
108
|
+
steps %{When I run `bundle install --local`}
|
109
|
+
end
|
110
|
+
|
111
|
+
Then /^the output should indicate that (\d+) tests? (?:was|were) run/ do |number|
|
112
|
+
# Rails 4 has slightly different output than Rails 3 due to
|
113
|
+
# Test::Unit::TestCase -> MiniTest
|
114
|
+
if rails_4?
|
115
|
+
steps %{Then the output should contain "#{number} tests, #{number} assertions, 0 failures, 0 errors, 0 skips"}
|
116
|
+
else
|
117
|
+
steps %{Then the output should contain "#{number} tests, #{number} assertions, 0 failures, 0 errors"}
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
Then /^the output should indicate that (\d+) unit and (\d+) functional tests? were run/ do |n1, n2|
|
122
|
+
n1 = n1.to_i
|
123
|
+
n2 = n2.to_i
|
124
|
+
total = n1.to_i + n2.to_i
|
125
|
+
# Rails 3 runs separate test suites in separate processes, but Rails 4 does
|
126
|
+
# not, so that's why we have to check for different things here
|
127
|
+
if rails_4?
|
128
|
+
steps %{Then the output should contain "#{total} tests, #{total} assertions, 0 failures, 0 errors, 0 skips"}
|
129
|
+
else
|
130
|
+
steps %{Then the output should match /#{n1} tests, #{n1} assertions, 0 failures, 0 errors.+#{n2} tests, #{n2} assertions, 0 failures, 0 errors/}
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
module FileHelpers
|
135
|
+
def append_to(path, contents)
|
136
|
+
in_current_dir do
|
137
|
+
File.open(path, 'a') do |file|
|
138
|
+
file.puts
|
139
|
+
file.puts contents
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
def append_to_gemfile(contents)
|
145
|
+
append_to('Gemfile', contents)
|
146
|
+
end
|
147
|
+
|
148
|
+
def comment_out_gem_in_gemfile(gemname)
|
149
|
+
in_current_dir do
|
150
|
+
gemfile = File.read('Gemfile')
|
151
|
+
gemfile.sub!(/^(\s*)(gem\s*['"]#{gemname})/, "\\1# \\2")
|
152
|
+
File.open('Gemfile', 'w'){ |file| file.write(gemfile) }
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
def rails_4?
|
157
|
+
match = ORIGINAL_BUNDLE_VARS['BUNDLE_GEMFILE'].match(/(\d)\.\d\.(\d\.)?gemfile$/)
|
158
|
+
match.captures[0] == '4'
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
World(FileHelpers)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "appraisal", "~> 0.4"
|
6
|
+
gem "aruba"
|
7
|
+
gem "bourne", "~> 1.3"
|
8
|
+
gem "bundler", "~> 1.1"
|
9
|
+
gem "cucumber", "~> 1.1"
|
10
|
+
gem "pry"
|
11
|
+
gem "rake", ">= 0.9.2"
|
12
|
+
gem "rspec-rails", ">= 2.13.1", "< 3"
|
13
|
+
gem "yard"
|
14
|
+
gem "shoulda-context", "~> 1.1.2"
|
15
|
+
gem "sqlite3", :platform=>:ruby
|
16
|
+
gem "activerecord-jdbc-adapter", :platform=>:jruby
|
17
|
+
gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
|
18
|
+
gem "jdbc-sqlite3", :platform=>:jruby
|
19
|
+
gem "jruby-openssl", :platform=>:jruby
|
20
|
+
gem "therubyrhino", :platform=>:jruby
|
21
|
+
gem "rails", "~> 3.0.17"
|
22
|
+
gem "strong_parameters"
|
23
|
+
|
24
|
+
gemspec :path=>".././"
|
@@ -0,0 +1,150 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
shoulda-matchers (2.5.0)
|
5
|
+
activesupport (>= 3.0.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
abstract (1.0.0)
|
11
|
+
actionmailer (3.0.20)
|
12
|
+
actionpack (= 3.0.20)
|
13
|
+
mail (~> 2.2.19)
|
14
|
+
actionpack (3.0.20)
|
15
|
+
activemodel (= 3.0.20)
|
16
|
+
activesupport (= 3.0.20)
|
17
|
+
builder (~> 2.1.2)
|
18
|
+
erubis (~> 2.6.6)
|
19
|
+
i18n (~> 0.5.0)
|
20
|
+
rack (~> 1.2.5)
|
21
|
+
rack-mount (~> 0.6.14)
|
22
|
+
rack-test (~> 0.5.7)
|
23
|
+
tzinfo (~> 0.3.23)
|
24
|
+
activemodel (3.0.20)
|
25
|
+
activesupport (= 3.0.20)
|
26
|
+
builder (~> 2.1.2)
|
27
|
+
i18n (~> 0.5.0)
|
28
|
+
activerecord (3.0.20)
|
29
|
+
activemodel (= 3.0.20)
|
30
|
+
activesupport (= 3.0.20)
|
31
|
+
arel (~> 2.0.10)
|
32
|
+
tzinfo (~> 0.3.23)
|
33
|
+
activeresource (3.0.20)
|
34
|
+
activemodel (= 3.0.20)
|
35
|
+
activesupport (= 3.0.20)
|
36
|
+
activesupport (3.0.20)
|
37
|
+
appraisal (1.0.0.beta2)
|
38
|
+
bundler
|
39
|
+
rake
|
40
|
+
thor (>= 0.14.0)
|
41
|
+
arel (2.0.10)
|
42
|
+
aruba (0.5.1)
|
43
|
+
childprocess (~> 0.3.6)
|
44
|
+
cucumber (>= 1.1.1)
|
45
|
+
rspec-expectations (>= 2.7.0)
|
46
|
+
bourne (1.4.0)
|
47
|
+
mocha (~> 0.13.2)
|
48
|
+
builder (2.1.2)
|
49
|
+
childprocess (0.3.9)
|
50
|
+
ffi (~> 1.0, >= 1.0.11)
|
51
|
+
coderay (1.1.0)
|
52
|
+
cucumber (1.2.3)
|
53
|
+
builder (>= 2.1.2)
|
54
|
+
diff-lcs (>= 1.1.3)
|
55
|
+
gherkin (~> 2.11.6)
|
56
|
+
multi_json (~> 1.3)
|
57
|
+
diff-lcs (1.2.1)
|
58
|
+
erubis (2.6.6)
|
59
|
+
abstract (>= 1.0.0)
|
60
|
+
ffi (1.4.0)
|
61
|
+
gherkin (2.11.6)
|
62
|
+
json (>= 1.7.6)
|
63
|
+
i18n (0.5.0)
|
64
|
+
json (1.7.7)
|
65
|
+
mail (2.2.19)
|
66
|
+
activesupport (>= 2.3.6)
|
67
|
+
i18n (>= 0.4.0)
|
68
|
+
mime-types (~> 1.16)
|
69
|
+
treetop (~> 1.4.8)
|
70
|
+
metaclass (0.0.1)
|
71
|
+
method_source (0.8.2)
|
72
|
+
mime-types (1.21)
|
73
|
+
mocha (0.13.3)
|
74
|
+
metaclass (~> 0.0.1)
|
75
|
+
multi_json (1.7.1)
|
76
|
+
polyglot (0.3.3)
|
77
|
+
pry (0.9.12.6)
|
78
|
+
coderay (~> 1.0)
|
79
|
+
method_source (~> 0.8)
|
80
|
+
slop (~> 3.4)
|
81
|
+
rack (1.2.8)
|
82
|
+
rack-mount (0.6.14)
|
83
|
+
rack (>= 1.0.0)
|
84
|
+
rack-test (0.5.7)
|
85
|
+
rack (>= 1.0)
|
86
|
+
rails (3.0.20)
|
87
|
+
actionmailer (= 3.0.20)
|
88
|
+
actionpack (= 3.0.20)
|
89
|
+
activerecord (= 3.0.20)
|
90
|
+
activeresource (= 3.0.20)
|
91
|
+
activesupport (= 3.0.20)
|
92
|
+
bundler (~> 1.0)
|
93
|
+
railties (= 3.0.20)
|
94
|
+
railties (3.0.20)
|
95
|
+
actionpack (= 3.0.20)
|
96
|
+
activesupport (= 3.0.20)
|
97
|
+
rake (>= 0.8.7)
|
98
|
+
rdoc (~> 3.4)
|
99
|
+
thor (~> 0.14.4)
|
100
|
+
rake (10.0.3)
|
101
|
+
rdoc (3.12.2)
|
102
|
+
json (~> 1.4)
|
103
|
+
rspec-core (2.13.1)
|
104
|
+
rspec-expectations (2.13.0)
|
105
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
106
|
+
rspec-mocks (2.13.1)
|
107
|
+
rspec-rails (2.13.2)
|
108
|
+
actionpack (>= 3.0)
|
109
|
+
activesupport (>= 3.0)
|
110
|
+
railties (>= 3.0)
|
111
|
+
rspec-core (~> 2.13.0)
|
112
|
+
rspec-expectations (~> 2.13.0)
|
113
|
+
rspec-mocks (~> 2.13.0)
|
114
|
+
shoulda-context (1.1.4)
|
115
|
+
slop (3.4.7)
|
116
|
+
sqlite3 (1.3.7)
|
117
|
+
strong_parameters (0.2.0)
|
118
|
+
actionpack (~> 3.0)
|
119
|
+
activemodel (~> 3.0)
|
120
|
+
railties (~> 3.0)
|
121
|
+
thor (0.14.6)
|
122
|
+
treetop (1.4.12)
|
123
|
+
polyglot
|
124
|
+
polyglot (>= 0.3.1)
|
125
|
+
tzinfo (0.3.37)
|
126
|
+
yard (0.8.7.3)
|
127
|
+
|
128
|
+
PLATFORMS
|
129
|
+
ruby
|
130
|
+
|
131
|
+
DEPENDENCIES
|
132
|
+
activerecord-jdbc-adapter
|
133
|
+
activerecord-jdbcsqlite3-adapter
|
134
|
+
appraisal (~> 1.0.0.beta2)
|
135
|
+
aruba
|
136
|
+
bourne (~> 1.3)
|
137
|
+
bundler (~> 1.1)
|
138
|
+
cucumber (~> 1.1)
|
139
|
+
jdbc-sqlite3
|
140
|
+
jruby-openssl
|
141
|
+
pry
|
142
|
+
rails (~> 3.0.17)
|
143
|
+
rake (>= 0.9.2)
|
144
|
+
rspec-rails (>= 2.13.1, < 3)
|
145
|
+
shoulda-context (~> 1.1.2)
|
146
|
+
shoulda-matchers!
|
147
|
+
sqlite3
|
148
|
+
strong_parameters
|
149
|
+
therubyrhino
|
150
|
+
yard
|