optionsful 0.2.3 → 0.3.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.
- data/.autotest +23 -0
- data/.document +5 -0
- data/.gitignore +25 -0
- data/{MIT-LICENSE → LICENSE} +2 -2
- data/README.rdoc +17 -0
- data/Rakefile +60 -5
- data/VERSION +1 -0
- data/config/optionsful.yml +18 -0
- data/features/optionsful.feature +9 -0
- data/features/support/env.rb +4 -0
- data/lib/baurets/optionsful/config.rb +35 -30
- data/lib/baurets/optionsful/introspections.rb +11 -59
- data/lib/baurets/optionsful/server.rb +39 -25
- data/lib/optionsful.rb +10 -9
- data/optionsful.gemspec +82 -0
- data/rails/init.rb +3 -7
- data/spec/config/optionsful.yml +18 -0
- data/spec/config/optionsful_host_auto.yml +18 -0
- data/spec/config/optionsful_link_false.yml +18 -0
- data/spec/fake_app.rb +6 -0
- data/spec/optionsful_config_spec.rb +32 -25
- data/spec/optionsful_server_spec.rb +279 -167
- data/spec/spec.opts +1 -4
- data/spec/spec_helper.rb +29 -19
- metadata +98 -26
- data/README.textile +0 -91
- data/lib/baurets/optionsful/version.rb +0 -16
- data/samples/optionsful.yml +0 -14
- data/spec/fixtures/optionsful.yml +0 -11
- /data/{spec/fixtures/optionsful_bug.yml → features/step_definitions/optionsful3_steps.rb} +0 -0
@@ -1,39 +1,46 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/spec_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
2
3
|
|
3
4
|
describe Baurets::Optionsful::Config do
|
4
5
|
|
5
6
|
include Rack::Test::Methods
|
6
7
|
|
7
8
|
context "Config carries specific settings" do
|
8
|
-
|
9
|
-
describe "
|
10
|
-
|
11
|
-
it "
|
12
|
-
config = Baurets::Optionsful::Config.new(
|
13
|
-
config.
|
9
|
+
|
10
|
+
describe "when there's no custom config file, use expected default settings" do
|
11
|
+
|
12
|
+
it "the Link header generation must be disabled" do
|
13
|
+
config = Baurets::Optionsful::Config.new("file_error.txt")
|
14
|
+
config.link.should be false
|
14
15
|
end
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "when there is a custom config file, load the settings from it" do
|
20
|
+
|
21
|
+
it "the Link header generation must be disabled" do
|
22
|
+
file = File.join(File.dirname(__FILE__), 'config', 'optionsful_link_false.yml')
|
23
|
+
config = Baurets::Optionsful::Config.new(file)
|
24
|
+
config.link.should be false
|
19
25
|
end
|
20
|
-
|
21
|
-
it "
|
22
|
-
config = Baurets::Optionsful::Config.new
|
23
|
-
config.
|
26
|
+
|
27
|
+
it "the Link header generation must be enabled" do
|
28
|
+
config = Baurets::Optionsful::Config.new(File.join(File.dirname(__FILE__), 'config', 'optionsful.yml'))
|
29
|
+
config.link.should be true
|
24
30
|
end
|
25
|
-
|
26
|
-
it "if
|
27
|
-
Baurets::Optionsful::Config.
|
28
|
-
config
|
29
|
-
config.
|
31
|
+
|
32
|
+
it "if the Link header generation is enabled, host value must be set" do
|
33
|
+
config = Baurets::Optionsful::Config.new(File.join(File.dirname(__FILE__), 'config', 'optionsful.yml'))
|
34
|
+
config.link.should be true
|
35
|
+
config.host.empty?.should_not be true
|
30
36
|
end
|
31
|
-
|
32
|
-
it "
|
33
|
-
config = Baurets::Optionsful::Config.new(
|
34
|
-
config.
|
37
|
+
|
38
|
+
it "if the Link header generation is enabled, host value accepts 'auto'" do
|
39
|
+
config = Baurets::Optionsful::Config.new(File.join(File.dirname(__FILE__), 'config', 'optionsful_host_auto.yml'))
|
40
|
+
config.link.should be true
|
41
|
+
config.host.should == "auto"
|
35
42
|
end
|
36
|
-
|
43
|
+
|
37
44
|
end
|
38
45
|
|
39
46
|
end
|