spree 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spree might be problematic. Click here for more details.
- data/CHANGELOG +6 -0
- data/config/environment.rb +1 -1
- data/lib/plugins/extension_patches/lib/routing_extension.rb +1 -11
- data/lib/spree.rb +1 -1
- data/lib/tasks/extensions.rake +15 -2
- data/spec/spec_helper.rb +64 -39
- metadata +4 -3
data/CHANGELOG
CHANGED
data/config/environment.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# ENV['RAILS_ENV'] ||= 'production'
|
6
6
|
|
7
7
|
# Specifies gem version of Rails to use when vendor/rails is not present
|
8
|
-
SPREE_GEM_VERSION = '0.4.
|
8
|
+
SPREE_GEM_VERSION = '0.4.1' unless defined? SPREE_GEM_VERSION
|
9
9
|
RAILS_GEM_VERSION = "2.1.0" unless defined? RAILS_GEM_VERSION
|
10
10
|
|
11
11
|
# Bootstrap the Rails environment, frameworks, and default configuration
|
@@ -9,23 +9,13 @@ module Spree
|
|
9
9
|
base.class_eval do
|
10
10
|
alias :draw_without_plugin_routes :draw
|
11
11
|
alias :draw :draw_with_plugin_routes
|
12
|
-
alias :rails_reload :reload
|
13
|
-
alias :reload :force_reload
|
14
12
|
end
|
15
13
|
end
|
16
14
|
|
17
|
-
def force_reload
|
18
|
-
if RAILS_ENV == 'development'
|
19
|
-
load!
|
20
|
-
else
|
21
|
-
rails_reload
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
15
|
def draw_with_plugin_routes
|
26
16
|
draw_without_plugin_routes do |mapper|
|
27
|
-
yield mapper
|
28
17
|
add_extension_routes(mapper)
|
18
|
+
yield mapper
|
29
19
|
end
|
30
20
|
end
|
31
21
|
|
data/lib/spree.rb
CHANGED
data/lib/tasks/extensions.rake
CHANGED
@@ -81,9 +81,22 @@ namespace :db do
|
|
81
81
|
end
|
82
82
|
|
83
83
|
namespace :spec do
|
84
|
-
desc "Runs specs on all available
|
84
|
+
desc "Runs specs on all available extensions in the current /vendor/extensions directory, pass EXT=extension_name to test a single extension"
|
85
85
|
task :extensions => "db:test:prepare" do
|
86
|
-
|
86
|
+
|
87
|
+
current_extensions_path = File.join(File.expand_path(Dir.pwd), 'vendor/extensions')
|
88
|
+
all_extension_names = Spree::Extension.descendants
|
89
|
+
all_extension_names.collect!{ |x| x.extension_name.tr(' ', '').underscore }
|
90
|
+
verified_extension_paths = []
|
91
|
+
|
92
|
+
all_extension_names.each do |ext_name|
|
93
|
+
extension_path = File.join(current_extensions_path, ext_name)
|
94
|
+
if File.directory?(extension_path)
|
95
|
+
verified_extension_paths << extension_path
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
extension_roots = verified_extension_paths
|
87
100
|
if ENV["EXT"]
|
88
101
|
extension_roots = extension_roots.select {|x| /\/(\d+_)?#{ENV["EXT"]}$/ === x }
|
89
102
|
if extension_roots.empty?
|
data/spec/spec_helper.rb
CHANGED
@@ -1,40 +1,65 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
1
|
+
unless defined? SPEC_ROOT
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
SPEC_ROOT = File.expand_path(File.dirname(__FILE__))
|
5
|
+
|
6
|
+
unless defined? SPREE_ROOT
|
7
|
+
if env_file = ENV["SPREE_ENV_FILE"]
|
8
|
+
require env_file
|
9
|
+
else
|
10
|
+
require File.expand_path(SPEC_ROOT + "/../config/environment")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
require 'spec'
|
14
|
+
require 'spec/rails'
|
15
|
+
# require 'scenarios'
|
16
|
+
require File.expand_path(File.dirname(__FILE__) + "/preference_factory")
|
17
|
+
|
18
|
+
class Test::Unit::TestCase
|
19
|
+
class << self
|
20
|
+
# Class method for test helpers
|
21
|
+
def test_helper(*names)
|
22
|
+
names.each do |name|
|
23
|
+
name = name.to_s
|
24
|
+
name = $1 if name =~ /^(.*?)_test_helper$/i
|
25
|
+
name = name.singularize
|
26
|
+
first_time = true
|
27
|
+
begin
|
28
|
+
constant = (name.camelize + 'TestHelper').constantize
|
29
|
+
self.class_eval { include constant }
|
30
|
+
rescue NameError
|
31
|
+
filename = File.expand_path(SPEC_ROOT + '/../test/helpers/' + name + '_test_helper.rb')
|
32
|
+
require filename if first_time
|
33
|
+
first_time = false
|
34
|
+
retry
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
alias :test_helpers :test_helper
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
Dir[SPREE_ROOT + '/spec/matchers/*_matcher.rb'].each do |matcher|
|
43
|
+
require matcher
|
44
|
+
end
|
45
|
+
|
46
|
+
# Scenario.load_paths.unshift "#{SPREE_ROOT}/spec/scenarios"
|
47
|
+
|
48
|
+
Spec::Runner.configure do |config|
|
49
|
+
config.use_transactional_fixtures = true
|
50
|
+
config.use_instantiated_fixtures = false
|
51
|
+
config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
|
52
|
+
|
53
|
+
# You can declare fixtures for each behaviour like this:
|
54
|
+
# describe "...." do
|
55
|
+
# fixtures :table_a, :table_b
|
56
|
+
#
|
57
|
+
# Alternatively, if you prefer to declare them only once, you can
|
58
|
+
# do so here, like so ...
|
59
|
+
#
|
60
|
+
# config.global_fixtures = :table_a, :table_b
|
61
|
+
#
|
62
|
+
# If you declare global fixtures, be aware that they will be declared
|
63
|
+
# for all of your examples, even those that don't use them.
|
64
|
+
end
|
40
65
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
@@ -9,7 +9,7 @@ autorequire: spree
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10-
|
12
|
+
date: 2008-10-14 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -2053,7 +2053,6 @@ files:
|
|
2053
2053
|
- vendor/plugins/resource_controller/test/test/unit/something_test.rb
|
2054
2054
|
- vendor/plugins/resource_controller/test/test/unit/tag_test.rb
|
2055
2055
|
- vendor/plugins/resource_controller/test/test/unit/urligence_test.rb
|
2056
|
-
- vendor/plugins/resource_controller/test/tmp
|
2057
2056
|
- vendor/plugins/resource_controller/test/vendor
|
2058
2057
|
- vendor/plugins/resource_controller/test/vendor/plugins
|
2059
2058
|
- vendor/plugins/resource_controller/test/vendor/plugins/shoulda
|
@@ -2809,6 +2808,8 @@ rdoc_options:
|
|
2809
2808
|
- --exclude
|
2810
2809
|
- log
|
2811
2810
|
- --exclude
|
2811
|
+
- pkg
|
2812
|
+
- --exclude
|
2812
2813
|
- public
|
2813
2814
|
- --exclude
|
2814
2815
|
- script
|