sinatra_more 0.3.23 → 0.3.24

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.23
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
- # insert_dependency_to_gemfile(name)
13
- # insert_dependency_to_gemfile(name, :env => :testing)
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}'" << (environment ? ", :only => #{environment.inspect}" : "") << "\n"
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
@@ -11,7 +11,7 @@ end
11
11
  TEST
12
12
 
13
13
  def setup_test
14
- require_dependencies 'rspec', :env => :testing
14
+ insert_into_gemfile 'rspec', :require_as => 'spec', :env => :testing
15
15
  insert_test_suite_setup RSPEC_SETUP
16
16
  end
17
17
 
data/sinatra_more.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sinatra_more}
8
- s.version = "0.3.23"
8
+ s.version = "0.3.24"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan Esquenazi"]
@@ -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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra_more
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.23
4
+ version: 0.3.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Esquenazi