factory_toys 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/factory_toys.gemspec +1 -1
- data/lib/factory_toys/f_factory.rb +6 -9
- data/lib/factory_toys.rb +1 -1
- data/spec/factory_toys_spec.rb +4 -6
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.3
|
data/factory_toys.gemspec
CHANGED
@@ -48,14 +48,11 @@ module FactoryToys
|
|
48
48
|
FileUtils.mkdir_p(dir)
|
49
49
|
FileUtils.rm_r(Dir.glob(File.join(dir, "*.feature")))
|
50
50
|
|
51
|
-
@outputs.each_with_index do |output, i|
|
52
|
-
File.
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
puts e
|
57
|
-
(debugger; puts '????')
|
58
|
-
end
|
51
|
+
@outputs.each_with_index do |output, i|
|
52
|
+
output_file_name = File.join(dir, "#{filename}_#{i}.feature")
|
53
|
+
File.open(output_file_name, 'w') do |f|
|
54
|
+
output_str = (@header + output).join("\n")
|
55
|
+
f.puts output_str
|
59
56
|
end
|
60
57
|
end
|
61
58
|
end
|
@@ -87,7 +84,7 @@ module FactoryToys
|
|
87
84
|
scenario_name = self.get_scenario_name(feature_name)
|
88
85
|
raise MissingScenarioError, scenario_name unless self.data[scenario_name]
|
89
86
|
eval(self.data[scenario_name])
|
90
|
-
@output
|
87
|
+
@output += eval(scenario_name.to_s).split("\n")
|
91
88
|
@output << ''
|
92
89
|
check_output_length
|
93
90
|
end
|
data/lib/factory_toys.rb
CHANGED
data/spec/factory_toys_spec.rb
CHANGED
@@ -70,15 +70,13 @@ describe "FactoryToys" do
|
|
70
70
|
|
71
71
|
it 'does not override file if no change' do
|
72
72
|
Object.send(:remove_const, :RAILS_ROOT)
|
73
|
-
path = File.dirname(__FILE__)
|
74
|
-
|
75
|
-
Object.const_set(:RAILS_ROOT, path + '/../tmp')
|
73
|
+
path = File.expand_path(File.dirname(__FILE__))
|
74
|
+
Object.const_set(:RAILS_ROOT, File.join(path, '..', 'tmp'))
|
76
75
|
FileUtils.rm_r(FactoryToys.features_location + '/*', :force => true)
|
77
76
|
FactoryToys.update_features
|
78
|
-
init_files = Dir.glob(FactoryToys.features_location
|
77
|
+
init_files = Dir.glob(File.join(FactoryToys.features_location, '**', '*.feature')).map{|f| [f, File.open(f){|file| file.read}]}
|
79
78
|
FactoryToys.update_features
|
80
|
-
new_files = Dir.glob(FactoryToys.features_location
|
81
|
-
|
79
|
+
new_files = Dir.glob(File.join(FactoryToys.features_location, '**', '*.feature')).map{|f| [f, File.open(f){|file| file.read}]}
|
82
80
|
init_files.first.last.should == new_files.first.last
|
83
81
|
end
|
84
82
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factory_toys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Henry
|