configured 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require 'rake'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec) do |s|
5
+ s.pattern = 'spec/*_spec.rb'
6
+ s.rspec_opts = ['--backtrace']
7
+ end
@@ -8,7 +8,7 @@ module Configured
8
8
  # Get settings for the required environment.
9
9
  def for_the(environment)
10
10
  begin
11
- settings = @configuration_data[environment] || raise
11
+ settings = @configuration_data[environment.to_s] || raise
12
12
 
13
13
  settings_hash = {}
14
14
  settings.each_key { |key| settings_hash[key.intern] = settings[key]}
@@ -2,7 +2,7 @@ module Configured # :nodoc:
2
2
  module Version # :nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
- TINY = 3
5
+ TINY = 4
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
@@ -16,8 +16,13 @@ module Configured
16
16
  ret = Settings.new(@configuration_fake).for_the("test")
17
17
  ret.should == {:setting => "value", :setting2 => "value2"}
18
18
  end
19
+
20
+ it "should return settings when environment name passed as symbol just like if environment name passed as string" do
21
+ ret = Settings.new(@configuration_fake).for_the(:test)
22
+ ret.should == {:setting => "value", :setting2 => "value2"}
23
+ end
19
24
 
20
- it "should raise expception if there is no such environment in config" do
25
+ it "should raise an expception if there is no such environment in config" do
21
26
  lambda {Settings.new(@configuration_fake).for_the("bad-entry")}.should raise_error
22
27
  end
23
28
  end
data/spec/spec_helper.rb CHANGED
@@ -4,12 +4,4 @@ require 'yaml'
4
4
  configured_src = '../../lib/configured'
5
5
  require File.expand_path(configured_src, __FILE__)
6
6
 
7
- # Rspec settings
8
- #RSpec.configure do |config|
9
- # config.mock_with :mocha
10
- # config.mock_with :flexmock
11
- # config.mock_with :rr
12
- # config.mock_with :rspec
13
- #end
14
-
15
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: configured
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-30 00:00:00.000000000Z
12
+ date: 2011-10-06 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: configured. Use your database.yaml in rails initters. For redis, redis-store
15
15
  and e.t.c.
@@ -26,6 +26,7 @@ files:
26
26
  - spec/settings_spec.rb
27
27
  - spec/spec_helper.rb
28
28
  - README.md
29
+ - Rakefile
29
30
  homepage: https://github.com/nettsundere/configured
30
31
  licenses: []
31
32
  post_install_message:
@@ -49,5 +50,5 @@ rubyforge_project:
49
50
  rubygems_version: 1.8.10
50
51
  signing_key:
51
52
  specification_version: 3
52
- summary: configured 1.0.3
53
+ summary: configured 1.0.4
53
54
  test_files: []