has_configuration 0.2.3 → 0.2.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b4c87a9c9cdb025d19875a2e5734dbeb790f993
4
- data.tar.gz: 05bf88f07b04cbbe9aacc63e0e891d27f93b9a7c
3
+ metadata.gz: ebff0280281752c0b1556b9a3b78ff373ef3d5f9
4
+ data.tar.gz: af60528f4c04a911de41688962cf09e286e1a1d3
5
5
  SHA512:
6
- metadata.gz: a1a3a4f8518d31dbecb814b96d01f3897b7e549604145592abb7da3e3d5c713f6524ab98b1047e50cd19d4995dac421af06635b78a78e8ab45f85b53c20d498a
7
- data.tar.gz: 006c38eeaa6607b80099db8d71ea8cafc3abd62ab120ecda5a8c7d9fd546583f9ad01f4c9185cccc0815fcd013e0a05dcf7470ab9f3fd524f25b862453a50191
6
+ metadata.gz: 0da42542ceb0db1259ae25374f8a81742d53983d31e7facebdda9496636bf1273dddf40a1aedb6a84b925719cc46591e69ffd15bb8de939f83295f20a390ce46
7
+ data.tar.gz: a73480c049c8520064fe58df406255e0f0070e85ef33975f65da5fd36ade95ddad7e4a60ebd0066fc8804d0a560bdca3d79810c0f9091e409aef221ede610902
@@ -1,5 +1,6 @@
1
1
  require 'active_support/core_ext/hash/indifferent_access'
2
2
  require 'ostruct'
3
+ require 'yaml'
3
4
 
4
5
  module HasConfiguration #:nodoc:all
5
6
  class Configuration
data/lib/version.rb CHANGED
@@ -2,7 +2,7 @@ module HasConfiguration #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- BUILD = 3
5
+ BUILD = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, BUILD].join('.')
8
8
  end
@@ -1,6 +1,8 @@
1
- require 'spec_helper'
1
+ require 'has_configuration'
2
2
 
3
- describe HasConfiguration::Configuration do
3
+ require 'support/rails_mock'
4
+
5
+ RSpec.describe HasConfiguration::Configuration do
4
6
  let(:klass) { Class }
5
7
 
6
8
  before do
@@ -1,11 +1,10 @@
1
- require 'spec_helper'
2
-
3
- describe HasConfiguration do
1
+ RSpec.describe HasConfiguration do
4
2
 
5
3
  context "when declared" do
6
4
 
7
5
  before(:all) do
8
6
  Dummy = Class.new do
7
+ require 'has_configuration'
9
8
  has_configuration :file => 'spec/fixtures/class.yml'
10
9
  end
11
10
  end
data/spec/spec_helper.rb CHANGED
@@ -1,21 +1,105 @@
1
- require 'yaml'
2
-
3
- require 'has_configuration'
4
- require 'has_configuration/configuration'
5
-
6
1
  if RUBY_VERSION >= "1.9"
7
2
  require 'coveralls'
8
3
  Coveralls.wear!
9
4
  end
10
5
 
6
+ # This file was generated by the `rspec --init` command. Conventionally, all
7
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
8
+ # The generated `.rspec` file contains `--require spec_helper` which will cause this
9
+ # file to always be loaded, without a need to explicitly require it in any files.
10
+ #
11
+ # Given that it is always loaded, you are encouraged to keep this file as
12
+ # light-weight as possible. Requiring heavyweight dependencies from this file
13
+ # will add to the boot time of your test suite on EVERY test run, even for an
14
+ # individual file that may not need all of that loaded. Instead, consider making
15
+ # a separate helper file that requires the additional dependencies and performs
16
+ # the additional setup, and require it from the spec files that actually need it.
17
+ #
18
+ # The `.rspec` file also contains a few flags that are not defaults but that
19
+ # users commonly want.
20
+ #
21
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
11
22
  RSpec.configure do |config|
23
+ # rspec-expectations config goes here. You can use an alternate
24
+ # assertion/expectation library such as wrong or the stdlib/minitest
25
+ # assertions if you prefer.
26
+ config.expect_with :rspec do |expectations|
27
+ # This option will default to `true` in RSpec 4. It makes the `description`
28
+ # and `failure_message` of custom matchers include text for helper methods
29
+ # defined using `chain`, e.g.:
30
+ # be_bigger_than(2).and_smaller_than(4).description
31
+ # # => "be bigger than 2 and smaller than 4"
32
+ # ...rather than:
33
+ # # => "be bigger than 2"
34
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
35
+ end
36
+
37
+ # rspec-mocks config goes here. You can use an alternate test double
38
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
12
39
  config.mock_with :rspec do |mocks|
40
+ # Enable only the newer, non-monkey-patching expect syntax.
41
+ # For more details, see:
42
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
43
+ mocks.syntax = :expect
44
+
45
+ # Prevents you from mocking or stubbing a method that does not exist on
46
+ # a real object. This is generally recommended, and will default to
47
+ # `true` in RSpec 4.
13
48
  mocks.verify_partial_doubles = true
14
49
  end
15
- end
16
50
 
17
- # Mocks Rails Environment
18
- Rails = Class.new do
19
- def self.root; Pathname.new("/RAILS_ROOT"); end
20
- def self.env ; 'test' ; end
51
+ # rspec-expectations config goes here. You can use an alternate
52
+ # assertion/expectation library such as wrong or the stdlib/minitest
53
+ # assertions if you prefer.
54
+ config.expect_with :rspec do |expectations|
55
+ # Enable only the newer, non-monkey-patching expect syntax.
56
+ # For more details, see:
57
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
58
+ expectations.syntax = :expect
59
+ end
60
+
61
+ # These two settings work together to allow you to limit a spec run
62
+ # to individual examples or groups you care about by tagging them with
63
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
64
+ # get run.
65
+ config.filter_run :focus
66
+ config.run_all_when_everything_filtered = true
67
+
68
+ # Limits the available syntax to the non-monkey patched syntax that is recommended.
69
+ # For more details, see:
70
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
71
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
72
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
73
+ config.disable_monkey_patching!
74
+
75
+ # This setting enables warnings. It's recommended, but in some cases may
76
+ # be too noisy due to issues in dependencies.
77
+ config.warnings = true
78
+
79
+ # Many RSpec users commonly either run the entire suite or an individual
80
+ # file, and it's useful to allow more verbose output when running an
81
+ # individual spec file.
82
+ if config.files_to_run.one?
83
+ # Use the documentation formatter for detailed output,
84
+ # unless a formatter has already been configured
85
+ # (e.g. via a command-line flag).
86
+ config.default_formatter = 'doc'
87
+ end
88
+
89
+ # Print the 10 slowest examples and example groups at the
90
+ # end of the spec run, to help surface which specs are running
91
+ # particularly slow.
92
+ config.profile_examples = 3
93
+
94
+ # Run specs in random order to surface order dependencies. If you find an
95
+ # order dependency and want to debug it, you can fix the order by providing
96
+ # the seed, which is printed after each run.
97
+ # --seed 1234
98
+ config.order = :random
99
+
100
+ # Seed global randomization in this process using the `--seed` CLI option.
101
+ # Setting this allows you to use `--seed` to deterministically reproduce
102
+ # test failures related to randomization by passing the same `--seed` value
103
+ # as the one that triggered the failure.
104
+ Kernel.srand config.seed
21
105
  end
@@ -0,0 +1,5 @@
1
+ # Mocks Rails Environment
2
+ Rails = Class.new do
3
+ def self.root; Pathname.new("/RAILS_ROOT"); end
4
+ def self.env ; 'test' ; end
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_configuration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Spickermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-07 00:00:00.000000000 Z
11
+ date: 2015-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -82,9 +82,10 @@ files:
82
82
  - spec/fixtures/with_defaults.yml
83
83
  - spec/fixtures/with_erb.yml
84
84
  - spec/fixtures/with_nested_attributes.yml
85
- - spec/has_configuration/configuration_spec.rb
86
- - spec/has_configuration_spec.rb
85
+ - spec/lib/has_configuration/configuration_spec.rb
86
+ - spec/lib/has_configuration_spec.rb
87
87
  - spec/spec_helper.rb
88
+ - spec/support/rails_mock.rb
88
89
  homepage: https://github.com/spickermann/has_configuration
89
90
  licenses:
90
91
  - MIT
@@ -92,7 +93,7 @@ metadata: {}
92
93
  post_install_message:
93
94
  rdoc_options: []
94
95
  require_paths:
95
- - - lib
96
+ - lib
96
97
  required_ruby_version: !ruby/object:Gem::Requirement
97
98
  requirements:
98
99
  - - ">="
@@ -105,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
106
  version: '0'
106
107
  requirements: []
107
108
  rubyforge_project:
108
- rubygems_version: 2.2.2
109
+ rubygems_version: 2.4.5
109
110
  signing_key:
110
111
  specification_version: 4
111
112
  summary: Simple configuration handling