-
-
Notifications
You must be signed in to change notification settings - Fork 763
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add an --init switch to the rspec command
- Closes #430.
- Loading branch information
1 parent
9e9f8a4
commit 3f482b7
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
module RSpec | ||
module Core | ||
class ProjectInitializer | ||
attr_reader :command | ||
|
||
def initialize(cmd) | ||
@command = cmd | ||
end | ||
|
||
def run | ||
FileUtils.mkdir_p 'spec' | ||
File.open 'spec/spec_helper.rb', 'w+' do |file| | ||
file.write <<-FILE | ||
require 'rspec' | ||
RSpec.configure do |c| | ||
c.mock_with :rspec | ||
end | ||
FILE | ||
end | ||
File.open 'spec/example_spec.rb', 'w+' do |file| | ||
file.write <<-FILE | ||
require 'spec_helper' | ||
describe 'example' do | ||
# let(:test_data) { 'testo' } | ||
# before do | ||
# some_setup_stuff | ||
# end | ||
# context 'doing something' do | ||
# it 'should behave like i want to' do | ||
# it.should be_true | ||
# end | ||
# end | ||
pending 'please remove this example and add your own spec!' | ||
end | ||
FILE | ||
end | ||
|
||
puts 'now run: rspec spec' | ||
end | ||
end | ||
end | ||
end |