factory_toys 0.4.1 → 0.4.2

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.4.1
1
+ 0.4.2
data/factory_toys.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{factory_toys}
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David Henry", "Thomas Brand"]
data/lib/factory_toys.rb CHANGED
@@ -36,7 +36,7 @@ module FactoryToys
36
36
  end
37
37
 
38
38
  def update_required(file, output_file)
39
- File.open(output_file) {|f| return "# last update: #{File.mtime(file)}" != f.readline}
39
+ File.open(output_file) {|f| return "# last update: #{File.mtime(file)}\n" != f.readline}
40
40
  rescue
41
41
  true
42
42
  end
@@ -67,7 +67,22 @@ describe "FactoryToys" do
67
67
  FileUtils.rm_r(FactoryToys.features_location + '/*', :force => true)
68
68
  FactoryToys.update_features
69
69
  end
70
+
71
+ it 'does not override file if no change' do
72
+ Object.send(:remove_const, :RAILS_ROOT)
73
+ path = File.dirname(__FILE__)
74
+ path += Dir.pwd + '/' unless path[0..0] == '/'
75
+ Object.const_set(:RAILS_ROOT, path + '/../tmp')
76
+ FileUtils.rm_r(FactoryToys.features_location + '/*', :force => true)
77
+ FactoryToys.update_features
78
+ init_files = Dir.glob(FactoryToys.features_location + '/*.feature').map{|f| [f, File.open(f){|file| file.read}]}
79
+ FactoryToys.update_features
80
+ new_files = Dir.glob(FactoryToys.features_location + '/*.feature').map{|f| [f, File.open(f){|file| file.read}]}
81
+
82
+ init_files.first.last.should == new_files.first.last
83
+ end
70
84
  end
85
+
71
86
  end
72
87
 
73
88
  end
@@ -1,6 +1,6 @@
1
1
  # last update: Wed Sep 15 18:00:01 +0100 2010
2
2
  # Auto Generated Features
3
- # Generated: Tue Oct 05 14:22:36 +0100 2010
3
+ # Generated: Tue Oct 05 14:45:43 +0100 2010
4
4
  # Source File: /Users/tom025/rails/factory-toys/spec/../tmp/ffactories/simple_factory.rb
5
5
 
6
6
  Test Instruction Queue and Processiung
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: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Henry