diff --git a/.rubocop.yml b/.rubocop.yml index 53a8789ae..84bb1c0f3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -33,7 +33,7 @@ Style/GuardClause: Style/IfUnlessModifier: Enabled: false -Metrics/LineLength: +Layout/LineLength: Max: 100 Style/RegexpLiteral: @@ -48,5 +48,5 @@ Style/TrailingCommaInHashLiteral: RSpec/InstanceVariable: Enabled: false -Lint/HandleExceptions: +Lint/SuppressedException: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 06864a813..bfac80a0d 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -32,7 +32,7 @@ Gemspec/OrderedDependencies: # SupportedHashRocketStyles: key, separator, table # SupportedColonStyles: key, separator, table # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit -Layout/AlignHash: +Layout/HashAlignment: Exclude: - 'lib/flipper/typecast.rb' @@ -81,7 +81,7 @@ Layout/EmptyLinesAroundExceptionHandlingKeywords: # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: squiggly, active_support, powerpack, unindent -Layout/IndentHeredoc: +Layout/HeredocIndentation: Exclude: - 'test/generators/flipper/active_record_generator_test.rb' @@ -138,13 +138,13 @@ Lint/ShadowingOuterLocalVariable: # Offense count: 2 # Cop supports --auto-correct. -Lint/UnneededCopDisableDirective: +Lint/RedundantCopDisableDirective: Exclude: - 'spec/flipper/adapter_spec.rb' # Offense count: 1 # Cop supports --auto-correct. -Lint/UnneededRequireStatement: +Lint/RedundantRequireStatement: Exclude: - 'lib/flipper/registry.rb' @@ -174,13 +174,13 @@ Metrics/BlockLength: # Offense count: 11 # Configuration parameters: CountComments. Metrics/ClassLength: - Max: 150 + Max: 160 # Offense count: 20 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https -Metrics/LineLength: +Layout/LineLength: Max: 251 # Offense count: 59 diff --git a/flipper-active_record.gemspec b/flipper-active_record.gemspec index a7cb4c0f0..b9e79434f 100644 --- a/flipper-active_record.gemspec +++ b/flipper-active_record.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |gem| 'lib/flipper/version.rb', ] gem.files = `git ls-files`.split("\n").select(&flipper_active_record_files) + extra_files - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_active_record_files) # rubocop:disable Metrics/LineLength + gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_active_record_files) # rubocop:disable Layout/LineLength gem.name = 'flipper-active_record' gem.require_paths = ['lib'] gem.version = Flipper::VERSION diff --git a/flipper-active_support_cache_store.gemspec b/flipper-active_support_cache_store.gemspec index cb0e211de..a34371d9b 100644 --- a/flipper-active_support_cache_store.gemspec +++ b/flipper-active_support_cache_store.gemspec @@ -14,8 +14,8 @@ Gem::Specification.new do |gem| gem.license = 'MIT' gem.homepage = 'https://github.com/jnunemaker/flipper' - gem.files = `git ls-files`.split("\n").select(&flipper_active_support_cache_store_files) + ['lib/flipper/version.rb'] # rubocop:disable Metrics/LineLength - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_active_support_cache_store_files) # rubocop:disable Metrics/LineLength + gem.files = `git ls-files`.split("\n").select(&flipper_active_support_cache_store_files) + ['lib/flipper/version.rb'] # rubocop:disable Layout/LineLength + gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_active_support_cache_store_files) # rubocop:disable Layout/LineLength gem.name = 'flipper-active_support_cache_store' gem.require_paths = ['lib'] gem.version = Flipper::VERSION diff --git a/flipper-api.gemspec b/flipper-api.gemspec index 554b07c51..130345c0f 100644 --- a/flipper-api.gemspec +++ b/flipper-api.gemspec @@ -13,8 +13,8 @@ Gem::Specification.new do |gem| gem.description = 'Rack middleware that provides an API for the flipper gem.' gem.license = 'MIT' gem.homepage = 'https://github.com/jnunemaker/flipper' - gem.files = `git ls-files`.split("\n").select(&flipper_api_files) + ['lib/flipper/version.rb'] # rubocop:disable Metrics/LineLength - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_api_files) # rubocop:disable Metrics/LineLength + gem.files = `git ls-files`.split("\n").select(&flipper_api_files) + ['lib/flipper/version.rb'] # rubocop:disable Layout/LineLength + gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_api_files) # rubocop:disable Layout/LineLength gem.name = 'flipper-api' gem.require_paths = ['lib'] gem.version = Flipper::VERSION diff --git a/flipper-cloud.gemspec b/flipper-cloud.gemspec index a962c39e4..6af2aff0c 100644 --- a/flipper-cloud.gemspec +++ b/flipper-cloud.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |gem| 'lib/flipper/version.rb', ] gem.files = `git ls-files`.split("\n").select(&flipper_cloud_files) + extra_files - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_cloud_files) # rubocop:disable Metrics/LineLength + gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_cloud_files) # rubocop:disable Layout/LineLength gem.name = 'flipper-cloud' gem.require_paths = ['lib'] gem.version = Flipper::VERSION diff --git a/flipper-dalli.gemspec b/flipper-dalli.gemspec index a1cfc0657..4cb189066 100644 --- a/flipper-dalli.gemspec +++ b/flipper-dalli.gemspec @@ -14,8 +14,8 @@ Gem::Specification.new do |gem| gem.license = 'MIT' gem.homepage = 'https://github.com/jnunemaker/flipper' - gem.files = `git ls-files`.split("\n").select(&flipper_dalli_files) + ['lib/flipper/version.rb'] # rubocop:disable Metrics/LineLength - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_dalli_files) # rubocop:disable Metrics/LineLength + gem.files = `git ls-files`.split("\n").select(&flipper_dalli_files) + ['lib/flipper/version.rb'] # rubocop:disable Layout/LineLength + gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_dalli_files) # rubocop:disable Layout/LineLength gem.name = 'flipper-dalli' gem.require_paths = ['lib'] gem.version = Flipper::VERSION diff --git a/flipper-moneta.gemspec b/flipper-moneta.gemspec index 4f60a4319..3bc875b97 100644 --- a/flipper-moneta.gemspec +++ b/flipper-moneta.gemspec @@ -13,8 +13,8 @@ Gem::Specification.new do |gem| gem.license = 'MIT' gem.homepage = 'https://github.com/jnunemaker/flipper' - gem.files = `git ls-files`.split("\n").select(&flipper_moneta_files) + ['lib/flipper/version.rb'] # rubocop:disable Metrics/LineLength - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_moneta_files) # rubocop:disable Metrics/LineLength + gem.files = `git ls-files`.split("\n").select(&flipper_moneta_files) + ['lib/flipper/version.rb'] # rubocop:disable Layout/LineLength + gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_moneta_files) # rubocop:disable Layout/LineLength gem.name = 'flipper-moneta' gem.require_paths = ['lib'] gem.version = Flipper::VERSION diff --git a/flipper-mongo.gemspec b/flipper-mongo.gemspec index 6e9e65632..fd0580ccd 100644 --- a/flipper-mongo.gemspec +++ b/flipper-mongo.gemspec @@ -14,8 +14,8 @@ Gem::Specification.new do |gem| gem.license = 'MIT' gem.homepage = 'https://github.com/jnunemaker/flipper' - gem.files = `git ls-files`.split("\n").select(&flipper_mongo_files) + ['lib/flipper/version.rb'] # rubocop:disable Metrics/LineLength - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_mongo_files) # rubocop:disable Metrics/LineLength + gem.files = `git ls-files`.split("\n").select(&flipper_mongo_files) + ['lib/flipper/version.rb'] # rubocop:disable Layout/LineLength + gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_mongo_files) # rubocop:disable Layout/LineLength gem.name = 'flipper-mongo' gem.require_paths = ['lib'] gem.version = Flipper::VERSION diff --git a/flipper-redis.gemspec b/flipper-redis.gemspec index dcb6690dd..dc4db2dea 100644 --- a/flipper-redis.gemspec +++ b/flipper-redis.gemspec @@ -14,8 +14,8 @@ Gem::Specification.new do |gem| gem.license = 'MIT' gem.homepage = 'https://github.com/jnunemaker/flipper' - gem.files = `git ls-files`.split("\n").select(&flipper_redis_files) + ['lib/flipper/version.rb'] # rubocop:disable Metrics/LineLength - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_redis_files) # rubocop:disable Metrics/LineLength + gem.files = `git ls-files`.split("\n").select(&flipper_redis_files) + ['lib/flipper/version.rb'] # rubocop:disable Layout/LineLength + gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_redis_files) # rubocop:disable Layout/LineLength gem.name = 'flipper-redis' gem.require_paths = ['lib'] gem.version = Flipper::VERSION diff --git a/flipper-rollout.gemspec b/flipper-rollout.gemspec index 04fb0555a..8b4b846d5 100644 --- a/flipper-rollout.gemspec +++ b/flipper-rollout.gemspec @@ -14,8 +14,8 @@ Gem::Specification.new do |gem| gem.license = 'MIT' gem.homepage = 'https://github.com/jnunemaker/flipper' - gem.files = `git ls-files`.split("\n").select(&flipper_rollout_files) + ['lib/flipper/version.rb'] # rubocop:disable Metrics/LineLength - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_rollout_files) # rubocop:disable Metrics/LineLength + gem.files = `git ls-files`.split("\n").select(&flipper_rollout_files) + ['lib/flipper/version.rb'] # rubocop:disable Layout/LineLength + gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_rollout_files) # rubocop:disable Layout/LineLength gem.name = 'flipper-rollout' gem.require_paths = ['lib'] gem.version = Flipper::VERSION diff --git a/flipper-sequel.gemspec b/flipper-sequel.gemspec index 0f2f46339..94e5111ab 100644 --- a/flipper-sequel.gemspec +++ b/flipper-sequel.gemspec @@ -16,7 +16,7 @@ Gem::Specification.new do |gem| 'lib/flipper/version.rb', ] gem.files = `git ls-files`.split("\n").select(&flipper_sequel_files) + extra_files - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_sequel_files) # rubocop:disable Metrics/LineLength + gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_sequel_files) # rubocop:disable Layout/LineLength gem.name = 'flipper-sequel' gem.require_paths = ['lib'] gem.version = Flipper::VERSION diff --git a/flipper-ui.gemspec b/flipper-ui.gemspec index 07ed48643..0e0ae77f0 100644 --- a/flipper-ui.gemspec +++ b/flipper-ui.gemspec @@ -10,11 +10,11 @@ Gem::Specification.new do |gem| gem.authors = ['John Nunemaker'] gem.email = ['nunemaker@gmail.com'] gem.summary = 'UI for the Flipper gem' - gem.description = 'Rack middleware that provides a fully featured web interface for the flipper gem.' # rubocop:disable Metrics/LineLength + gem.description = 'Rack middleware that provides a fully featured web interface for the flipper gem.' # rubocop:disable Layout/LineLength gem.license = 'MIT' gem.homepage = 'https://github.com/jnunemaker/flipper' - gem.files = `git ls-files`.split("\n").select(&flipper_ui_files) + ['lib/flipper/version.rb'] # rubocop:disable Metrics/LineLength + gem.files = `git ls-files`.split("\n").select(&flipper_ui_files) + ['lib/flipper/version.rb'] # rubocop:disable Layout/LineLength gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_ui_files) gem.name = 'flipper-ui' gem.require_paths = ['lib'] diff --git a/flipper.gemspec b/flipper.gemspec index 81e0063ae..6426e4d61 100644 --- a/flipper.gemspec +++ b/flipper.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |gem| gem.authors = ['John Nunemaker'] gem.email = ['nunemaker@gmail.com'] gem.summary = 'Feature flipper for ANYTHING' - gem.description = 'Feature flipper is the act of enabling/disabling features in your application, ideally without re-deploying or changing anything in your code base. Flipper makes this extremely easy to do with any backend you would like to use.' # rubocop:disable Metrics/LineLength + gem.description = 'Feature flipper is the act of enabling/disabling features in your application, ideally without re-deploying or changing anything in your code base. Flipper makes this extremely easy to do with any backend you would like to use.' # rubocop:disable Layout/LineLength gem.homepage = 'https://github.com/jnunemaker/flipper' gem.license = 'MIT' diff --git a/lib/flipper/adapters/sequel.rb b/lib/flipper/adapters/sequel.rb index ce986b0f5..5e52a2328 100644 --- a/lib/flipper/adapters/sequel.rb +++ b/lib/flipper/adapters/sequel.rb @@ -121,24 +121,9 @@ def get_all def enable(feature, gate, thing) case gate.data_type when :boolean - @gate_class.db.transaction do - clear(feature) - args = { - feature_key: feature.key, - key: gate.key.to_s, - } - @gate_class.where(args).delete - @gate_class.create(gate_attrs(feature, gate, thing)) - end + set(feature, gate, thing, clear: true) when :integer - @gate_class.db.transaction do - args = { - feature_key: feature.key, - key: gate.key.to_s, - } - @gate_class.where(args).delete - @gate_class.create(gate_attrs(feature, gate, thing)) - end + set(feature, gate, thing) when :set begin @gate_class.create(gate_attrs(feature, gate, thing)) @@ -163,15 +148,7 @@ def disable(feature, gate, thing) when :boolean clear(feature) when :integer - @gate_class.db.transaction do - args = { - feature_key: feature.key.to_s, - key: gate.key.to_s, - } - @gate_class.where(args).delete - - @gate_class.create(gate_attrs(feature, gate, thing)) - end + set(feature, gate, thing) when :set @gate_class.where(gate_attrs(feature, gate, thing)) .delete @@ -188,6 +165,20 @@ def unsupported_data_type(data_type) raise "#{data_type} is not supported by this adapter" end + def set(feature, gate, thing, options = {}) + clear_feature = options.fetch(:clear, false) + args = { + feature_key: feature.key, + key: gate.key.to_s, + } + + @gate_class.db.transaction do + clear(feature) if clear_feature + @gate_class.where(args).delete + @gate_class.create(gate_attrs(feature, gate, thing)) + end + end + def gate_attrs(feature, gate, thing) { feature_key: feature.key.to_s, diff --git a/lib/flipper/middleware/memoizer.rb b/lib/flipper/middleware/memoizer.rb index af5395138..3fb2ed87f 100644 --- a/lib/flipper/middleware/memoizer.rb +++ b/lib/flipper/middleware/memoizer.rb @@ -23,7 +23,7 @@ class Memoizer # def initialize(app, opts = {}) if opts.is_a?(Flipper::DSL) || opts.is_a?(Proc) - raise 'Flipper::Middleware::Memoizer no longer initializes with a flipper instance or block. Read more at: https://git.io/vSo31.' # rubocop:disable LineLength + raise 'Flipper::Middleware::Memoizer no longer initializes with a flipper instance or block. Read more at: https://git.io/vSo31.' # rubocop:disable Layout/LineLength end @app = app diff --git a/lib/flipper/ui/configuration.rb b/lib/flipper/ui/configuration.rb index 03f569303..a73727338 100644 --- a/lib/flipper/ui/configuration.rb +++ b/lib/flipper/ui/configuration.rb @@ -49,9 +49,9 @@ class Configuration def initialize @actors = Option.new("Actors", "Enable actors using the form above.") @groups = Option.new("Groups", "Enable groups using the form above.") - @percentage_of_actors = Option.new("Percentage of Actors", "Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable Metrics/LineLength - @percentage_of_time = Option.new("Percentage of Time", "Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable Metrics/LineLength - @delete = Option.new("Danger Zone", "Deleting a feature removes it from the list of features and disables it for everyone.") # rubocop:disable Metrics/LineLength + @percentage_of_actors = Option.new("Percentage of Actors", "Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable Layout/LineLength + @percentage_of_time = Option.new("Percentage of Time", "Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable Layout/LineLength + @delete = Option.new("Danger Zone", "Deleting a feature removes it from the list of features and disables it for everyone.") # rubocop:disable Layout/LineLength @banner_text = nil @banner_class = 'danger' @feature_creation_enabled = true diff --git a/spec/flipper/ui/actions/actors_gate_spec.rb b/spec/flipper/ui/actions/actors_gate_spec.rb index e0bbb23bb..3e3f1a711 100644 --- a/spec/flipper/ui/actions/actors_gate_spec.rb +++ b/spec/flipper/ui/actions/actors_gate_spec.rb @@ -73,23 +73,23 @@ context 'empty value' do let(:value) { '' } - # rubocop:disable Metrics/LineLength + # rubocop:disable Layout/LineLength it 'redirects back to feature' do expect(last_response.status).to be(302) expect(last_response.headers['Location']).to eq('/features/search/actors?error=%22%22+is+not+a+valid+actor+value.') end - # rubocop:enable Metrics/LineLength + # rubocop:enable Layout/LineLength end context 'nil value' do let(:value) { nil } - # rubocop:disable Metrics/LineLength + # rubocop:disable Layout/LineLength it 'redirects back to feature' do expect(last_response.status).to be(302) expect(last_response.headers['Location']).to eq('/features/search/actors?error=%22%22+is+not+a+valid+actor+value.') end - # rubocop:enable Metrics/LineLength + # rubocop:enable Layout/LineLength end end end diff --git a/spec/flipper/ui/actions/features_spec.rb b/spec/flipper/ui/actions/features_spec.rb index 158c22f98..5d7bca07d 100644 --- a/spec/flipper/ui/actions/features_spec.rb +++ b/spec/flipper/ui/actions/features_spec.rb @@ -111,12 +111,12 @@ expect(flipper.features.map(&:key)).to eq([]) end - # rubocop:disable Metrics/LineLength + # rubocop:disable Layout/LineLength it 'redirects back to feature' do expect(last_response.status).to be(302) expect(last_response.headers['Location']).to eq('/features/new?error=%22%22+is+not+a+valid+feature+name.') end - # rubocop:enable Metrics/LineLength + # rubocop:enable Layout/LineLength end context 'nil feature name' do @@ -126,12 +126,12 @@ expect(flipper.features.map(&:key)).to eq([]) end - # rubocop:disable Metrics/LineLength + # rubocop:disable Layout/LineLength it 'redirects back to feature' do expect(last_response.status).to be(302) expect(last_response.headers['Location']).to eq('/features/new?error=%22%22+is+not+a+valid+feature+name.') end - # rubocop:enable Metrics/LineLength + # rubocop:enable Layout/LineLength end end end diff --git a/spec/flipper/ui/actions/groups_gate_spec.rb b/spec/flipper/ui/actions/groups_gate_spec.rb index a74a2f63e..570f3dc8d 100644 --- a/spec/flipper/ui/actions/groups_gate_spec.rb +++ b/spec/flipper/ui/actions/groups_gate_spec.rb @@ -72,34 +72,34 @@ context 'unknown group name' do let(:group_name) { 'not_here' } - # rubocop:disable Metrics/LineLength + # rubocop:disable Layout/LineLength it 'redirects back to feature' do expect(last_response.status).to be(302) expect(last_response.headers['Location']).to eq('/features/search/groups?error=The+group+named+%22not_here%22+has+not+been+registered.') end - # rubocop:enable Metrics/LineLength + # rubocop:enable Layout/LineLength end context 'empty group name' do let(:group_name) { '' } - # rubocop:disable Metrics/LineLength + # rubocop:disable Layout/LineLength it 'redirects back to feature' do expect(last_response.status).to be(302) expect(last_response.headers['Location']).to eq('/features/search/groups?error=The+group+named+%22%22+has+not+been+registered.') end - # rubocop:enable Metrics/LineLength + # rubocop:enable Layout/LineLength end context 'nil group name' do let(:group_name) { nil } - # rubocop:disable Metrics/LineLength + # rubocop:disable Layout/LineLength it 'redirects back to feature' do expect(last_response.status).to be(302) expect(last_response.headers['Location']).to eq('/features/search/groups?error=The+group+named+%22%22+has+not+been+registered.') end - # rubocop:enable Metrics/LineLength + # rubocop:enable Layout/LineLength end end end diff --git a/spec/flipper/ui/actions/percentage_of_actors_gate_spec.rb b/spec/flipper/ui/actions/percentage_of_actors_gate_spec.rb index 78bbe2c3b..18c78335a 100644 --- a/spec/flipper/ui/actions/percentage_of_actors_gate_spec.rb +++ b/spec/flipper/ui/actions/percentage_of_actors_gate_spec.rb @@ -41,12 +41,12 @@ expect(flipper[:search].percentage_of_actors_value).to be(0) end - # rubocop:disable Metrics/LineLength + # rubocop:disable Layout/LineLength it 'redirects back to feature' do expect(last_response.status).to be(302) expect(last_response.headers['Location']).to eq('/features/search?error=Invalid+percentage+of+actors+value%3A+value+must+be+a+positive+number+less+than+or+equal+to+100%2C+but+was+555') end - # rubocop:enable Metrics/LineLength + # rubocop:enable Layout/LineLength end end end diff --git a/spec/flipper/ui/actions/percentage_of_time_gate_spec.rb b/spec/flipper/ui/actions/percentage_of_time_gate_spec.rb index 2e71f7fad..4ca9546f9 100644 --- a/spec/flipper/ui/actions/percentage_of_time_gate_spec.rb +++ b/spec/flipper/ui/actions/percentage_of_time_gate_spec.rb @@ -41,12 +41,12 @@ expect(flipper[:search].percentage_of_time_value).to be(0) end - # rubocop:disable Metrics/LineLength + # rubocop:disable Layout/LineLength it 'redirects back to feature' do expect(last_response.status).to be(302) expect(last_response.headers['Location']).to eq('/features/search?error=Invalid+percentage+of+time+value%3A+value+must+be+a+positive+number+less+than+or+equal+to+100%2C+but+was+555') end - # rubocop:enable Metrics/LineLength + # rubocop:enable Layout/LineLength end end end diff --git a/spec/flipper/ui/configuration_spec.rb b/spec/flipper/ui/configuration_spec.rb index d0f52207f..e7b0411b3 100644 --- a/spec/flipper/ui/configuration_spec.rb +++ b/spec/flipper/ui/configuration_spec.rb @@ -25,21 +25,21 @@ describe "#percentage_of_actors" do it "has default text" do expect(configuration.percentage_of_actors.title).to eq("Percentage of Actors") - expect(configuration.percentage_of_actors.description).to eq("Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable Metrics/LineLength + expect(configuration.percentage_of_actors.description).to eq("Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable Layout/LineLength end end describe "#percentage_of_time" do it "has default text" do expect(configuration.percentage_of_time.title).to eq("Percentage of Time") - expect(configuration.percentage_of_time.description).to eq("Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable Metrics/LineLength + expect(configuration.percentage_of_time.description).to eq("Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable Layout/LineLength end end describe "#delete" do it "has default text" do expect(configuration.delete.title).to eq("Danger Zone") - expect(configuration.delete.description).to eq("Deleting a feature removes it from the list of features and disables it for everyone.") # rubocop:disable Metrics/LineLength + expect(configuration.delete.description).to eq("Deleting a feature removes it from the list of features and disables it for everyone.") # rubocop:disable Layout/LineLength end end diff --git a/spec/helper.rb b/spec/helper.rb index af43d907c..cda5ab72f 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -17,7 +17,7 @@ require 'flipper-ui' require 'flipper-api' -Dir[FlipperRoot.join('spec/support/**/*.rb')].each { |f| require f } +Dir[FlipperRoot.join('spec/support/**/*.rb')].sort.each { |f| require f } RSpec.configure do |config| config.before(:example) do diff --git a/test/test_helper.rb b/test/test_helper.rb index d80df34c1..8c615ecb5 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,6 @@ require 'flipper' require 'minitest/autorun' require 'minitest/unit' -Dir['./lib/flipper/test/*.rb'].each { |f| require(f) } +Dir['./lib/flipper/test/*.rb'].sort.each { |f| require(f) } FlipperRoot = Pathname(__FILE__).dirname.join('..').expand_path