fix_to_chix 0.0.1
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/History.txt +4 -0
- data/Manifest.txt +24 -0
- data/PostInstall.txt +0 -0
- data/README.rdoc +67 -0
- data/Rakefile +29 -0
- data/bin/fixtochix +4 -0
- data/lib/fix_to_chix/controller.rb +25 -0
- data/lib/fix_to_chix/factory_writer.rb +13 -0
- data/lib/fix_to_chix/fixture_parser.rb +52 -0
- data/lib/fix_to_chix/fixture_selector.rb +33 -0
- data/lib/fix_to_chix.rb +27 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/spec/controller_spec.rb +11 -0
- data/spec/factory_writer_spec.rb +5 -0
- data/spec/fixture_parser_spec.rb +78 -0
- data/spec/fixture_selector_spec.rb +20 -0
- data/spec/fixtures/authors.yml +10 -0
- data/spec/fixtures/line_items.yml +4 -0
- data/spec/fixtures/posts.yml +8 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +12 -0
- data/tasks/rspec.rake +42 -0
- metadata +111 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
History.txt
|
2
|
+
Manifest.txt
|
3
|
+
PostInstall.txt
|
4
|
+
README.rdoc
|
5
|
+
Rakefile
|
6
|
+
bin/fixtochix
|
7
|
+
lib/fix_to_chix.rb
|
8
|
+
lib/fix_to_chix/controller.rb
|
9
|
+
lib/fix_to_chix/factory_writer.rb
|
10
|
+
lib/fix_to_chix/fixture_parser.rb
|
11
|
+
lib/fix_to_chix/fixture_selector.rb
|
12
|
+
script/console
|
13
|
+
script/destroy
|
14
|
+
script/generate
|
15
|
+
spec/controller_spec.rb
|
16
|
+
spec/factory_writer_spec.rb
|
17
|
+
spec/fixture_parser_spec.rb
|
18
|
+
spec/fixture_selector_spec.rb
|
19
|
+
spec/fixtures/authors.yml
|
20
|
+
spec/fixtures/line_items.yml
|
21
|
+
spec/fixtures/posts.yml
|
22
|
+
spec/spec.opts
|
23
|
+
spec/spec_helper.rb
|
24
|
+
tasks/rspec.rake
|
data/PostInstall.txt
ADDED
File without changes
|
data/README.rdoc
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
= fix_to_chix
|
2
|
+
|
3
|
+
http://github.com/caike/fix_to_chix
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
convert existing yaml fixtures to {factory_girl}[http://github.com/thoughtbot/factory_girl] factories
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
|
11
|
+
It currently looks for yml files in your test and spec folders and translates them to factory_girl factory definitions written to test/factories.rb or spec/factories.rb
|
12
|
+
|
13
|
+
It does not differ fixtures with the same name in different files. For example, a fixture named *one* in authors.yml will have the same factory name as *one* in posts.yml:
|
14
|
+
|
15
|
+
Factory.define :one, :class_name => Author do |a|
|
16
|
+
...
|
17
|
+
end
|
18
|
+
|
19
|
+
Factory.define :one, :class_name => Post do |p|
|
20
|
+
...
|
21
|
+
end
|
22
|
+
|
23
|
+
I may solve that by using a name like :author_one and :post_one, but I'm still thinking about it.
|
24
|
+
|
25
|
+
== SYNOPSIS:
|
26
|
+
|
27
|
+
Two simple steps to run fix_to_chix:
|
28
|
+
|
29
|
+
$ cd <you_app_base>
|
30
|
+
$ fixtochix
|
31
|
+
|
32
|
+
== REQUIREMENTS:
|
33
|
+
|
34
|
+
rubygems, hoe, activesupport
|
35
|
+
|
36
|
+
== INSTALL:
|
37
|
+
|
38
|
+
Make sure you have gemcutter in your sources:
|
39
|
+
|
40
|
+
(1) sudo gem install gemcutter
|
41
|
+
(2) gem tumble
|
42
|
+
(3) sudo gem install fix_to_chix
|
43
|
+
|
44
|
+
== LICENSE:
|
45
|
+
|
46
|
+
(The MIT License)
|
47
|
+
|
48
|
+
Copyright (c) 2009 {Caike Souza}[http://www.caikesouza.com]
|
49
|
+
|
50
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
51
|
+
a copy of this software and associated documentation files (the
|
52
|
+
'Software'), to deal in the Software without restriction, including
|
53
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
54
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
55
|
+
permit persons to whom the Software is furnished to do so, subject to
|
56
|
+
the following conditions:
|
57
|
+
|
58
|
+
The above copyright notice and this permission notice shall be
|
59
|
+
included in all copies or substantial portions of the Software.
|
60
|
+
|
61
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
62
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
63
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
64
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
65
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
66
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
67
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
|
2
|
+
require File.dirname(__FILE__) + '/lib/fix_to_chix'
|
3
|
+
require 'hoe'
|
4
|
+
# Generate all the Rake tasks
|
5
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
6
|
+
$hoe = Hoe.new('fix_to_chix', FixToChix::VERSION) do |p|
|
7
|
+
p.developer('Caike Souza', 'caikesouza@caikesouza.com')
|
8
|
+
p.summary = 'convert existing yaml fixtures to factory_girl factories'
|
9
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
10
|
+
p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
|
11
|
+
p.rubyforge_name = p.name # TODO this is default value
|
12
|
+
# p.extra_deps = [
|
13
|
+
# ['activesupport','>= 2.0.2'],
|
14
|
+
# ]
|
15
|
+
p.extra_dev_deps = [
|
16
|
+
['newgem', ">= #{::Newgem::VERSION}"], ['activesupport']
|
17
|
+
]
|
18
|
+
|
19
|
+
p.clean_globs |= %w[**/.DS_Store tmp *.log]
|
20
|
+
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
|
21
|
+
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
|
22
|
+
p.rsync_args = '-av --delete --ignore-errors'
|
23
|
+
end
|
24
|
+
|
25
|
+
require 'newgem/tasks' # load /tasks/*.rake
|
26
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
27
|
+
|
28
|
+
# TODO - want other tests/tasks run by default? Add them to the list
|
29
|
+
# task :default => [:spec, :features]
|
data/bin/fixtochix
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'fix_to_chix/fixture_selector'
|
2
|
+
require 'fix_to_chix/factory_writer'
|
3
|
+
require 'fix_to_chix/fixture_parser'
|
4
|
+
|
5
|
+
module FixToChix
|
6
|
+
class Controller
|
7
|
+
def self.parse_it_all!
|
8
|
+
|
9
|
+
selector = FixtureSelector.new
|
10
|
+
|
11
|
+
selector.spec_fixtures.each do |fixture_file_name|
|
12
|
+
parser = FixtureParser.new(fixture_file_name)
|
13
|
+
parser.parse_fixture
|
14
|
+
FactoryWriter.write(parser.output_buffer, SPEC_TARGET_FILE)
|
15
|
+
end
|
16
|
+
|
17
|
+
selector.test_fixtures.each do |fixture_file_name|
|
18
|
+
parser = FixtureParser.new(fixture_file_name)
|
19
|
+
parser.parse_fixture
|
20
|
+
FactoryWriter.write(parser.output_buffer, TEST_TARGET_FILE)
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module FixToChix
|
2
|
+
|
3
|
+
class FixtureParser
|
4
|
+
|
5
|
+
attr_reader :output_buffer, :factory_names, :factory_writer
|
6
|
+
|
7
|
+
def initialize(fixture_file)
|
8
|
+
raise ArgumentError if fixture_file.nil?
|
9
|
+
raise StandardError unless File.exists?(fixture_file)
|
10
|
+
@fixture_file = fixture_file
|
11
|
+
end
|
12
|
+
|
13
|
+
def model_name
|
14
|
+
@fixture_file.match(/(\w+)\.yml/)
|
15
|
+
$1.singularize
|
16
|
+
end
|
17
|
+
|
18
|
+
def parse_fixture
|
19
|
+
@current_fixture = YAML.load_file(@fixture_file)
|
20
|
+
@factory_names = @current_fixture.map{ |key, value| key }
|
21
|
+
@output_buffer = define_factories
|
22
|
+
end
|
23
|
+
|
24
|
+
def attributes_for(factory_name)
|
25
|
+
@current_fixture[factory_name].map {|key, value| key if key != "id" }
|
26
|
+
end
|
27
|
+
|
28
|
+
def define_factories
|
29
|
+
factory_definition = []
|
30
|
+
@factory_names.each do |name|
|
31
|
+
factory_definition << "Factory.define :#{name}, :class => #{model_name.camelize} do |#{model_name[0].chr}|"
|
32
|
+
define_attributes_for(name).each do |attrib|
|
33
|
+
factory_definition << attrib
|
34
|
+
end
|
35
|
+
factory_definition << "end"
|
36
|
+
factory_definition << ""
|
37
|
+
end
|
38
|
+
factory_definition
|
39
|
+
end
|
40
|
+
|
41
|
+
def define_attributes_for(name)
|
42
|
+
attributes = attributes_for(name)
|
43
|
+
attributes.map {|attr| write_factory_attribute(name, attr) }.reverse
|
44
|
+
end
|
45
|
+
|
46
|
+
def write_factory_attribute(name, attribute)
|
47
|
+
attr_value = @current_fixture[name][attribute]
|
48
|
+
attr_value = attr_value.to_i == 0 ? "'#{attr_value}'" : "#{attr_value}"
|
49
|
+
" #{model_name[0].chr}.#{attribute} #{attr_value}"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module FixToChix
|
2
|
+
|
3
|
+
class FixtureSelector
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
end
|
7
|
+
|
8
|
+
def spec_fixtures(options={})
|
9
|
+
all_fixtures = fetch_fixtures(options).select {|f| f =~ /spec/ }
|
10
|
+
filter(all_fixtures, options)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_fixtures(options={})
|
14
|
+
all_fixtures = fetch_fixtures(options).select {|f| f =~ /test/ }
|
15
|
+
filter(all_fixtures, options)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
def fetch_fixtures(options)
|
20
|
+
project_fixtures = []
|
21
|
+
project_fixtures.concat(Dir[TEST_FIXTURES]) unless Dir[TEST_FIXTURES].empty?
|
22
|
+
project_fixtures.concat(Dir[SPEC_FIXTURES]) unless Dir[SPEC_FIXTURES].empty?
|
23
|
+
project_fixtures
|
24
|
+
end
|
25
|
+
|
26
|
+
def filter(all_fixtures, options)
|
27
|
+
return all_fixtures.select {|f| f =~ options[:matching] } unless options[:matching].nil?
|
28
|
+
all_fixtures
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
data/lib/fix_to_chix.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__)) unless
|
2
|
+
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
require 'activesupport'
|
6
|
+
require 'fix_to_chix/controller'
|
7
|
+
|
8
|
+
module FixToChix
|
9
|
+
|
10
|
+
VERSION = '0.0.1'
|
11
|
+
|
12
|
+
APP_ROOT = "." # have to call fixtochix from the app base
|
13
|
+
|
14
|
+
TEST_FIXTURES = "#{APP_ROOT}/test/fixtures/*"
|
15
|
+
SPEC_FIXTURES = "#{APP_ROOT}/spec/fixtures/*"
|
16
|
+
|
17
|
+
SPEC_TARGET = "#{APP_ROOT}/spec"
|
18
|
+
TEST_TARGET = "#{APP_ROOT}/test"
|
19
|
+
|
20
|
+
SPEC_TARGET_FILE = "#{SPEC_TARGET}/factories.rb"
|
21
|
+
TEST_TARGET_FILE = "#{TEST_TARGET}/factories.rb"
|
22
|
+
|
23
|
+
def self.execute
|
24
|
+
FixToChix::Controller.parse_it_all!
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
data/script/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# File: script/console
|
3
|
+
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
+
|
5
|
+
libs = " -r irb/completion"
|
6
|
+
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
+
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
+
libs << " -r #{File.dirname(__FILE__) + '/../lib/fix_to_chix.rb'}"
|
9
|
+
puts "Loading fix_to_chix gem"
|
10
|
+
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/destroy'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/generate'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Generate.new.run(ARGV)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper.rb'
|
2
|
+
|
3
|
+
describe FixToChix::Controller do
|
4
|
+
|
5
|
+
it "should parse it all" do
|
6
|
+
selector = mock('FixtureSelector', :spec_fixtures => [], :test_fixtures => [])
|
7
|
+
FixToChix::FixtureSelector.should_receive(:new).and_return(selector)
|
8
|
+
FixToChix::Controller.parse_it_all!
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper.rb'
|
2
|
+
|
3
|
+
describe FixToChix::FixtureParser do
|
4
|
+
|
5
|
+
it "raises error if no fixture file passed as argument" do
|
6
|
+
lambda { FixToChix::FixtureParser.new }.should raise_error
|
7
|
+
end
|
8
|
+
|
9
|
+
it "raises error if file not found" do
|
10
|
+
lambda { FixToChix::FixtureParser.new("bla/bla/bla") }.should raise_error
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "reading file" do
|
14
|
+
|
15
|
+
it "lists model class name" do
|
16
|
+
parser = FixToChix::FixtureParser.new(File.dirname(__FILE__) + "/fixtures/authors.yml")
|
17
|
+
parser.model_name.should == "author"
|
18
|
+
parser = FixToChix::FixtureParser.new(File.dirname(__FILE__) + "/fixtures/posts.yml")
|
19
|
+
parser.model_name.should == "post"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "parsing" do
|
24
|
+
|
25
|
+
before do
|
26
|
+
@parser = FixToChix::FixtureParser.new(File.dirname(__FILE__) + "/fixtures/authors.yml")
|
27
|
+
@parser.parse_fixture
|
28
|
+
end
|
29
|
+
|
30
|
+
it "saves output in output_buffer" do
|
31
|
+
@parser.output_buffer.should_not be_empty
|
32
|
+
end
|
33
|
+
|
34
|
+
it "has factory names" do
|
35
|
+
@parser.factory_names.to_set.should == Set.new(["anakin", "yoda"])
|
36
|
+
end
|
37
|
+
|
38
|
+
it "has attributes for each factory name" do
|
39
|
+
@parser.attributes_for("anakin").should include("name", "blog")
|
40
|
+
end
|
41
|
+
|
42
|
+
it "doest not include id attribute" do
|
43
|
+
@parser.attributes_for("anakin").should_not include("id")
|
44
|
+
end
|
45
|
+
|
46
|
+
it "writes defines factories" do
|
47
|
+
@parser.parse_fixture
|
48
|
+
@parser.output_buffer.join.should match(/Factory.define :anakin, :class => Author/)
|
49
|
+
|
50
|
+
parser = FixToChix::FixtureParser.new(File.dirname(__FILE__) + "/fixtures/posts.yml")
|
51
|
+
parser.parse_fixture
|
52
|
+
parser.output_buffer.join.should match(/Factory.define :hello_world, :class => Post do \|p\|/)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "camelizes class_name" do
|
56
|
+
parser = FixToChix::FixtureParser.new(File.dirname(__FILE__) + "/fixtures/line_items.yml")
|
57
|
+
parser.parse_fixture
|
58
|
+
parser.output_buffer.join.should match(/Factory.define :bla, :class => LineItem do \|l\|/)
|
59
|
+
end
|
60
|
+
|
61
|
+
it "write attributes " do
|
62
|
+
@parser.parse_fixture
|
63
|
+
@parser.output_buffer.join.should match(/a.blog/)
|
64
|
+
|
65
|
+
parser = FixToChix::FixtureParser.new(File.dirname(__FILE__) + "/fixtures/posts.yml")
|
66
|
+
parser.parse_fixture
|
67
|
+
parser.output_buffer.join.should match(/p.title/)
|
68
|
+
end
|
69
|
+
|
70
|
+
it "writes attributes with respective values" do
|
71
|
+
@parser.parse_fixture
|
72
|
+
@parser.output_buffer.join.should match(/a.blog 'I write a blog'/)
|
73
|
+
@parser.output_buffer.join.should match(/a.age 900/)
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper.rb'
|
2
|
+
|
3
|
+
describe FixToChix::FixtureSelector, "selecting fixtures" do
|
4
|
+
|
5
|
+
before do
|
6
|
+
@ftc_fixture_selector = FixToChix::FixtureSelector.new
|
7
|
+
@ftc_fixture_selector.stub!(:fetch_fixtures).and_return(["spec/fixtures/users.yml","spec/fixtures/user_items.yml", "test/posts.yml"])
|
8
|
+
end
|
9
|
+
|
10
|
+
it "selects all fixtures by default" do
|
11
|
+
@ftc_fixture_selector.spec_fixtures.should == ["spec/fixtures/users.yml","spec/fixtures/user_items.yml"]
|
12
|
+
@ftc_fixture_selector.test_fixtures.should == ["test/posts.yml"]
|
13
|
+
end
|
14
|
+
|
15
|
+
it "selects matching with regexp" do
|
16
|
+
@ftc_fixture_selector.spec_fixtures(:matching => /item/).should == ["spec/fixtures/user_items.yml"]
|
17
|
+
@ftc_fixture_selector.test_fixtures(:matching => /user/).should == []
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/spec/spec_helper.rb
ADDED
data/tasks/rspec.rake
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
begin
|
2
|
+
require 'spec'
|
3
|
+
rescue LoadError
|
4
|
+
require 'rubygems'
|
5
|
+
require 'spec'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'spec/rake/spectask'
|
9
|
+
rescue LoadError
|
10
|
+
puts <<-EOS
|
11
|
+
To use rspec for testing you must install rspec gem:
|
12
|
+
gem install rspec
|
13
|
+
EOS
|
14
|
+
exit(0)
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Run the specs under spec/models"
|
18
|
+
Spec::Rake::SpecTask.new do |t|
|
19
|
+
t.spec_opts = ['--options', "spec/spec.opts"]
|
20
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
21
|
+
end
|
22
|
+
|
23
|
+
namespace :fix_to_chix do
|
24
|
+
desc "Convert your fixtures to factory"
|
25
|
+
task :convert => :environment do
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
require 'spec/rake/spectask'
|
30
|
+
require "rcov/rcovtask"
|
31
|
+
|
32
|
+
namespace :spec do
|
33
|
+
desc "Code coverage."
|
34
|
+
Spec::Rake::SpecTask.new(:coverage) do |rcov|
|
35
|
+
rcov.rcov = true
|
36
|
+
rcov.rcov_dir = "reports/coverage"
|
37
|
+
rcov.spec_opts = ["--format", "html:reports/specs/index.html", "--diff"]
|
38
|
+
rcov.fail_on_error = false
|
39
|
+
rcov.verbose = true
|
40
|
+
rcov.rcov_opts = [" -x gem, -x spec"]
|
41
|
+
end
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fix_to_chix
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Caike Souza
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-10-30 00:00:00 -04:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: newgem
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.5.2
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activesupport
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: hoe
|
37
|
+
type: :development
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 2.3.3
|
44
|
+
version:
|
45
|
+
description: ""
|
46
|
+
email:
|
47
|
+
- caikesouza@caikesouza.com
|
48
|
+
executables:
|
49
|
+
- fixtochix
|
50
|
+
extensions: []
|
51
|
+
|
52
|
+
extra_rdoc_files:
|
53
|
+
- History.txt
|
54
|
+
- Manifest.txt
|
55
|
+
- PostInstall.txt
|
56
|
+
files:
|
57
|
+
- History.txt
|
58
|
+
- Manifest.txt
|
59
|
+
- PostInstall.txt
|
60
|
+
- README.rdoc
|
61
|
+
- Rakefile
|
62
|
+
- bin/fixtochix
|
63
|
+
- lib/fix_to_chix.rb
|
64
|
+
- lib/fix_to_chix/controller.rb
|
65
|
+
- lib/fix_to_chix/factory_writer.rb
|
66
|
+
- lib/fix_to_chix/fixture_parser.rb
|
67
|
+
- lib/fix_to_chix/fixture_selector.rb
|
68
|
+
- script/console
|
69
|
+
- script/destroy
|
70
|
+
- script/generate
|
71
|
+
- spec/controller_spec.rb
|
72
|
+
- spec/factory_writer_spec.rb
|
73
|
+
- spec/fixture_parser_spec.rb
|
74
|
+
- spec/fixture_selector_spec.rb
|
75
|
+
- spec/fixtures/authors.yml
|
76
|
+
- spec/fixtures/line_items.yml
|
77
|
+
- spec/fixtures/posts.yml
|
78
|
+
- spec/spec.opts
|
79
|
+
- spec/spec_helper.rb
|
80
|
+
- tasks/rspec.rake
|
81
|
+
has_rdoc: true
|
82
|
+
homepage:
|
83
|
+
licenses: []
|
84
|
+
|
85
|
+
post_install_message: PostInstall.txt
|
86
|
+
rdoc_options:
|
87
|
+
- --main
|
88
|
+
- README.txt
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: "0"
|
96
|
+
version:
|
97
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: "0"
|
102
|
+
version:
|
103
|
+
requirements: []
|
104
|
+
|
105
|
+
rubyforge_project: fix_to_chix
|
106
|
+
rubygems_version: 1.3.5
|
107
|
+
signing_key:
|
108
|
+
specification_version: 3
|
109
|
+
summary: convert existing yaml fixtures to factory_girl factories
|
110
|
+
test_files: []
|
111
|
+
|