sinatra_more 0.3.23 → 0.3.24
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/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.24
|
@@ -9,12 +9,15 @@ module SinatraMore
|
|
9
9
|
end
|
10
10
|
|
11
11
|
# Inserts a required gem into the Gemfile to add the bundler dependency
|
12
|
-
#
|
13
|
-
#
|
12
|
+
# insert_into_gemfile(name)
|
13
|
+
# insert_into_gemfile(name, :env => :testing)
|
14
14
|
def insert_into_gemfile(name, options={})
|
15
15
|
after_pattern = "# Component requirements\n"
|
16
16
|
after_pattern = "# #{options[:env].to_s.capitalize} requirements\n" if environment = options[:env]
|
17
|
-
include_text = "gem '#{name}'"
|
17
|
+
include_text = "gem '#{name}'"
|
18
|
+
include_text << ", :require_as => #{options[:require_as].inspect}" if options[:require_as]
|
19
|
+
include_text << ", :only => #{environment.inspect}" if environment
|
20
|
+
include_text << "\n"
|
18
21
|
options.merge!(:content => include_text, :after => after_pattern)
|
19
22
|
inject_into_file('Gemfile', options[:content], :after => options[:after])
|
20
23
|
end
|
data/sinatra_more.gemspec
CHANGED
@@ -168,7 +168,7 @@ class TestSkeletonGenerator < Test::Unit::TestCase
|
|
168
168
|
should "properly generate for rspec" do
|
169
169
|
buffer = silence_logger { SinatraMore::SkeletonGenerator.start(['sample_app', '/tmp', '--test=rspec', '--script=none']) }
|
170
170
|
assert_match /Applying.*?rspec.*?test/, buffer
|
171
|
-
assert_match_in_file(/gem 'rspec'/, '/tmp/sample_app/Gemfile')
|
171
|
+
assert_match_in_file(/gem 'rspec', :require_as => "spec"/, '/tmp/sample_app/Gemfile')
|
172
172
|
assert_match_in_file(/Spec::Runner/, '/tmp/sample_app/test/test_config.rb')
|
173
173
|
end
|
174
174
|
|