sinsiliux-hornsby 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hornsby.rb +6 -4
- data/spec/hornsby_spec.rb +8 -1
- data/spec/spec_helper.rb +1 -1
- data/test/hornsby_test.rb +8 -1
- metadata +2 -3
data/lib/hornsby.rb
CHANGED
@@ -8,9 +8,11 @@ else
|
|
8
8
|
end
|
9
9
|
|
10
10
|
class Hornsby
|
11
|
-
SCENARIO_FILES = [nil,
|
12
|
-
|
13
|
-
|
11
|
+
SCENARIO_FILES = [nil, "spec", "test"].map do |dir|
|
12
|
+
["hornsby_scenarios", "hornsby_scenario"].map do |file|
|
13
|
+
path = File.join([dir, file].compact)
|
14
|
+
["#{path}.rb", File.join(path, "*.rb")]
|
15
|
+
end
|
14
16
|
end.flatten
|
15
17
|
|
16
18
|
@@delete_sql = "DELETE FROM %s"
|
@@ -154,4 +156,4 @@ class Hornsby
|
|
154
156
|
puts
|
155
157
|
raise error
|
156
158
|
end
|
157
|
-
end
|
159
|
+
end
|
data/spec/hornsby_spec.rb
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/spec_helper'
|
2
2
|
|
3
3
|
describe Hornsby do
|
4
|
+
describe "scenario files" do
|
5
|
+
it "should be loaded from specified dirs" do
|
6
|
+
Hornsby::SCENARIO_FILES.should == ["hornsby_scenarios.rb", "hornsby_scenarios/*.rb", "hornsby_scenario.rb", "hornsby_scenario/*.rb", "spec/hornsby_scenarios.rb", "spec/hornsby_scenarios/*.rb", "spec/hornsby_scenario.rb", "spec/hornsby_scenario/*.rb", "test/hornsby_scenarios.rb", "test/hornsby_scenarios/*.rb", "test/hornsby_scenario.rb", "test/hornsby_scenario/*.rb"]
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
4
10
|
describe "with just_apple scenario" do
|
5
11
|
before do
|
6
12
|
hornsby_scenario :just_apple
|
@@ -184,4 +190,5 @@ describe Hornsby do
|
|
184
190
|
# @peach.species.should == 'peach'
|
185
191
|
# end
|
186
192
|
#end
|
187
|
-
end
|
193
|
+
end
|
194
|
+
|
data/spec/spec_helper.rb
CHANGED
@@ -21,5 +21,5 @@ require 'db/fruit'
|
|
21
21
|
require 'db/tree'
|
22
22
|
|
23
23
|
Spec::Runner.configure do |config|
|
24
|
-
|
24
|
+
config.enable_hornsby(:root => File.expand_path(File.join(spec_dir, '..')), :scenarios => :big_cherry)
|
25
25
|
end
|
data/test/hornsby_test.rb
CHANGED
@@ -2,6 +2,12 @@ require File.dirname(__FILE__) + '/test_helper'
|
|
2
2
|
require 'shoulda'
|
3
3
|
|
4
4
|
class HornsbyTest < ActiveSupport::TestCase
|
5
|
+
context "scenario files" do
|
6
|
+
should "be loaded from specified dirs" do
|
7
|
+
assert(Hornsby::SCENARIO_FILES == ["hornsby_scenarios.rb", "hornsby_scenarios/*.rb", "hornsby_scenario.rb", "hornsby_scenario/*.rb", "spec/hornsby_scenarios.rb", "spec/hornsby_scenarios/*.rb", "spec/hornsby_scenario.rb", "spec/hornsby_scenario/*.rb", "test/hornsby_scenarios.rb", "test/hornsby_scenarios/*.rb", "test/hornsby_scenario.rb", "test/hornsby_scenario/*.rb"])
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
5
11
|
context "with just_apple scenario" do
|
6
12
|
setup do
|
7
13
|
hornsby_scenario :just_apple
|
@@ -185,4 +191,5 @@ class HornsbyTest < ActiveSupport::TestCase
|
|
185
191
|
# @peach.species.should == 'peach'
|
186
192
|
# end
|
187
193
|
#end
|
188
|
-
end
|
194
|
+
end
|
195
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinsiliux-hornsby
|
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
|
- Andrius Chamentauskas
|
@@ -43,7 +43,6 @@ files:
|
|
43
43
|
- LICENSE
|
44
44
|
has_rdoc: false
|
45
45
|
homepage: http://github.com/sinsiliux/hornsby
|
46
|
-
licenses:
|
47
46
|
post_install_message:
|
48
47
|
rdoc_options: []
|
49
48
|
|
@@ -64,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
63
|
requirements: []
|
65
64
|
|
66
65
|
rubyforge_project:
|
67
|
-
rubygems_version: 1.
|
66
|
+
rubygems_version: 1.2.0
|
68
67
|
signing_key:
|
69
68
|
specification_version: 2
|
70
69
|
summary: Fixtures replacement with scenarios
|