sail 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -1
- data/app/controllers/sail/settings_controller.rb +2 -0
- data/app/models/sail/setting.rb +3 -1
- data/lib/false_class.rb +1 -1
- data/lib/sail.rb +12 -0
- data/lib/sail/engine.rb +6 -1
- data/lib/sail/version.rb +1 -1
- data/lib/true_class.rb +1 -1
- data/spec/controllers/sail/settings_controller_spec.rb +10 -0
- data/spec/dummy/config/sail.yml +48 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/log/development.log +180 -0
- data/spec/dummy/log/test.log +13698 -0
- data/spec/dummy/tmp/cache/850/CA0/setting_get_negative +1 -0
- data/spec/dummy/tmp/cache/863/380/setting_get_whatever +1 -1
- data/spec/dummy/tmp/cache/873/A40/setting_get_throttle +1 -0
- data/spec/lib/false_class_spec.rb +8 -0
- data/spec/lib/true_class_spec.rb +8 -0
- data/spec/models/sail/setting_spec.rb +6 -0
- data/spec/sail_spec.rb +30 -0
- metadata +12 -2
@@ -0,0 +1 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry :@valuei:
|
@@ -1 +1 @@
|
|
1
|
-
o: ActiveSupport::Cache::Entry :@value0:
|
1
|
+
o: ActiveSupport::Cache::Entry :@value0:
|
@@ -0,0 +1 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry :@valueF:
|
@@ -265,6 +265,12 @@ describe Sail::Setting, type: :model do
|
|
265
265
|
let(:random_value) { 0.75 }
|
266
266
|
it { expect { subject }.to raise_error(Sail::Setting::UnexpectedCastType) }
|
267
267
|
end
|
268
|
+
|
269
|
+
context "when throttle setting does not exist" do
|
270
|
+
let!(:throttle_setting) { described_class.create!(name: :wrong_name, cast_type: :boolean, value: "true") }
|
271
|
+
let(:random_value) { 0.75 }
|
272
|
+
it { expect { subject }.to raise_error(ActiveRecord::RecordNotFound) }
|
273
|
+
end
|
268
274
|
end
|
269
275
|
|
270
276
|
describe '#display_name' do
|
data/spec/sail_spec.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
describe Sail, type: :lib do
|
4
|
+
describe ".get" do
|
5
|
+
subject { described_class.get("name") }
|
6
|
+
|
7
|
+
it "delegates to setting" do
|
8
|
+
expect(Sail::Setting).to receive(:get).with("name")
|
9
|
+
subject
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe ".set" do
|
14
|
+
subject { described_class.set("name", "value") }
|
15
|
+
|
16
|
+
it "delegates to setting" do
|
17
|
+
expect(Sail::Setting).to receive(:set).with("name", "value")
|
18
|
+
subject
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe ".switcher" do
|
23
|
+
subject { described_class.switcher(positive: "positive", negative: "negative", throttled_by: "throttle") }
|
24
|
+
|
25
|
+
it "delegates to setting" do
|
26
|
+
expect(Sail::Setting).to receive(:switcher).with(positive: "positive", negative: "negative", throttled_by: "throttle")
|
27
|
+
subject
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vinicius Stock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fugit
|
@@ -325,7 +325,9 @@ files:
|
|
325
325
|
- spec/dummy/public/apple-touch-icon-precomposed.png
|
326
326
|
- spec/dummy/public/apple-touch-icon.png
|
327
327
|
- spec/dummy/public/favicon.ico
|
328
|
+
- spec/dummy/tmp/cache/850/CA0/setting_get_negative
|
328
329
|
- spec/dummy/tmp/cache/863/380/setting_get_whatever
|
330
|
+
- spec/dummy/tmp/cache/873/A40/setting_get_throttle
|
329
331
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/-5/-5PsrQhwunIjXgeJWtbq-uv2bBapr1cMvzqRXO1hyRY.cache
|
330
332
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/-8/-8irZEzcIYS66q_1B2VoxRZIOZhMJcN2d72yNN-EAfk.cache
|
331
333
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/-B/-BbRF6zv7y6rbYK9dDNyDKtLLBrmUHtsmMMfV_-WsKA.cache
|
@@ -1656,7 +1658,10 @@ files:
|
|
1656
1658
|
- spec/features/viewing_settings_feature_spec.rb
|
1657
1659
|
- spec/helpers/sail/application_helper_spec.rb
|
1658
1660
|
- spec/lib/configuration_spec.rb
|
1661
|
+
- spec/lib/false_class_spec.rb
|
1662
|
+
- spec/lib/true_class_spec.rb
|
1659
1663
|
- spec/models/sail/setting_spec.rb
|
1664
|
+
- spec/sail_spec.rb
|
1660
1665
|
- spec/spec_helper.rb
|
1661
1666
|
homepage: https://github.com/vinistock/sail
|
1662
1667
|
licenses:
|
@@ -1749,6 +1754,8 @@ test_files:
|
|
1749
1754
|
- spec/dummy/log/test.log
|
1750
1755
|
- spec/dummy/log/production.log
|
1751
1756
|
- spec/dummy/log/development.log
|
1757
|
+
- spec/dummy/tmp/cache/873/A40/setting_get_throttle
|
1758
|
+
- spec/dummy/tmp/cache/850/CA0/setting_get_negative
|
1752
1759
|
- spec/dummy/tmp/cache/863/380/setting_get_whatever
|
1753
1760
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/y2/y2y8fK4sOu7L7UfQGH0cCtO-HodUc1zhC6PtFk5vqbk.cache
|
1754
1761
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/V6/V6KXX931kvu7n5TCHfnNFxdblPbBitzmN7CCDqKsxZo.cache
|
@@ -3078,7 +3085,10 @@ test_files:
|
|
3078
3085
|
- spec/features/editing_settings_feature_spec.rb
|
3079
3086
|
- spec/features/searching_settings_feature_spec.rb
|
3080
3087
|
- spec/features/viewing_settings_feature_spec.rb
|
3088
|
+
- spec/sail_spec.rb
|
3081
3089
|
- spec/models/sail/setting_spec.rb
|
3082
3090
|
- spec/lib/configuration_spec.rb
|
3091
|
+
- spec/lib/false_class_spec.rb
|
3092
|
+
- spec/lib/true_class_spec.rb
|
3083
3093
|
- spec/controllers/sail/settings_controller_spec.rb
|
3084
3094
|
- spec/helpers/sail/application_helper_spec.rb
|