blueprints 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/blueprints.gemspec +5 -1
- data/features/blueprints.feature +21 -0
- data/features/step_definitions/blueprints_steps.rb +18 -0
- data/features/support/env.rb +19 -0
- data/lib/blueprints.rb +7 -1
- data/lib/blueprints/extensions/cucumber.rb +8 -0
- data/spec/test_all.sh +8 -4
- metadata +7 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.2
|
data/blueprints.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{blueprints}
|
8
|
-
s.version = "0.7.
|
8
|
+
s.version = "0.7.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andrius Chamentauskas"]
|
@@ -26,6 +26,9 @@ Gem::Specification.new do |s|
|
|
26
26
|
"VERSION",
|
27
27
|
"bin/blueprintify",
|
28
28
|
"blueprints.gemspec",
|
29
|
+
"features/blueprints.feature",
|
30
|
+
"features/step_definitions/blueprints_steps.rb",
|
31
|
+
"features/support/env.rb",
|
29
32
|
"init.rb",
|
30
33
|
"install.rb",
|
31
34
|
"lib/blueprints.rb",
|
@@ -37,6 +40,7 @@ Gem::Specification.new do |s|
|
|
37
40
|
"lib/blueprints/convertable/fixtures.rb",
|
38
41
|
"lib/blueprints/database_backends/active_record.rb",
|
39
42
|
"lib/blueprints/errors.rb",
|
43
|
+
"lib/blueprints/extensions/cucumber.rb",
|
40
44
|
"lib/blueprints/extensions/deprecated.rb",
|
41
45
|
"lib/blueprints/extensions/rspec.rb",
|
42
46
|
"lib/blueprints/extensions/test_unit.rb",
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Feature: blueprints
|
2
|
+
In order to use blueprints with cucumber
|
3
|
+
As a developer
|
4
|
+
I should be able build blueprints with correct data
|
5
|
+
|
6
|
+
Scenario: build cherry
|
7
|
+
Given I have apple
|
8
|
+
Then apple should be available
|
9
|
+
And apple should be a fruit
|
10
|
+
And apple species should be "apple"
|
11
|
+
|
12
|
+
Scenario: no cherry
|
13
|
+
Then apple should NOT be available
|
14
|
+
|
15
|
+
Scenario: big cherry prebuild
|
16
|
+
When big_cherry size is 10
|
17
|
+
Then I set big_cherry size to 15
|
18
|
+
|
19
|
+
Scenario: big cherry another prebuild
|
20
|
+
When big_cherry size is 10
|
21
|
+
Then I set big_cherry size to 15
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Given /^I have (\w+)$/ do |name|
|
2
|
+
build name
|
3
|
+
end
|
4
|
+
Then /^(\w+) should (NOT )?be available$/ do |name, negative|
|
5
|
+
instance_variable_get("@#{name}").send(negative.present? ? :should : :should_not, be_nil)
|
6
|
+
end
|
7
|
+
Then /^(\w+) should be a (\w+)$/ do |name, type|
|
8
|
+
instance_variable_get("@#{name}").should be_instance_of(type.classify.constantize)
|
9
|
+
end
|
10
|
+
Then /^(\w+) species should be "([^\"]*)"$/ do |name, species|
|
11
|
+
instance_variable_get("@#{name}").species.should == species
|
12
|
+
end
|
13
|
+
When /^big_cherry size is 10$/ do
|
14
|
+
@big_cherry.average_diameter.should == 7
|
15
|
+
end
|
16
|
+
Then /^I set big_cherry size to 15$/ do
|
17
|
+
@big_cherry.average_diameter = 15
|
18
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'cucumber'
|
2
|
+
require 'active_record'
|
3
|
+
Root = File.expand_path(File.dirname(__FILE__) + '/../..')
|
4
|
+
require File.expand_path(Root + '/lib/blueprints')
|
5
|
+
|
6
|
+
ActiveRecord::Base.logger = Logger.new("debug.log")
|
7
|
+
databases = YAML::load_file(Root + "/spec/active_record/fixtures/database.yml")
|
8
|
+
db_info = databases[ENV["DB"] || "test"]
|
9
|
+
ActiveRecord::Base.establish_connection(db_info)
|
10
|
+
# Comment out the next two lines if you're not using RSpec's matchers (should / should_not) in your steps.
|
11
|
+
#require 'cucumber/rspec'
|
12
|
+
|
13
|
+
require Root + '/spec/active_record/fixtures/fruit'
|
14
|
+
require Root + '/spec/active_record/fixtures/tree'
|
15
|
+
|
16
|
+
Blueprints.enable do |config|
|
17
|
+
config.root = Root + '/spec/active_record'
|
18
|
+
config.prebuild = :big_cherry
|
19
|
+
end
|
data/lib/blueprints.rb
CHANGED
@@ -31,7 +31,13 @@ module Blueprints
|
|
31
31
|
def self.enable
|
32
32
|
yield config if block_given?
|
33
33
|
load
|
34
|
-
extension =
|
34
|
+
extension = if defined? Cucumber
|
35
|
+
'cucumber'
|
36
|
+
elsif defined? Spec or defined? RSpec
|
37
|
+
'rspec'
|
38
|
+
else
|
39
|
+
'test_unit'
|
40
|
+
end
|
35
41
|
require File.join(File.dirname(__FILE__), 'blueprints', 'extensions', extension)
|
36
42
|
end
|
37
43
|
|
data/spec/test_all.sh
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#!/bin/bash
|
1
2
|
function e {
|
2
3
|
echo ''
|
3
4
|
echo '----------------------------------------'
|
@@ -11,16 +12,19 @@ spec spec/active_record/blueprints_spec.rb
|
|
11
12
|
e "Without transactions"
|
12
13
|
NO_TRANSACTIONS=true spec spec/active_record/blueprints_spec.rb
|
13
14
|
|
14
|
-
e "With Rails 3"
|
15
|
-
rvm 1.8.7
|
16
|
-
RAILS=3 rspec spec/active_record/blueprints_spec.rb
|
17
|
-
|
18
15
|
e "With no db"
|
19
16
|
spec spec/no_db/blueprints_spec.rb
|
20
17
|
|
21
18
|
e "With Test::Unit"
|
22
19
|
ruby test/blueprints_test.rb
|
23
20
|
|
21
|
+
e "With Cucumber"
|
22
|
+
cucumber features/blueprints.feature
|
23
|
+
|
24
|
+
e "With Rails 3"
|
25
|
+
rvm 1.8.7
|
26
|
+
RAILS=3 rspec spec/active_record/blueprints_spec.rb
|
27
|
+
|
24
28
|
e "With ruby 1.9.1"
|
25
29
|
rvm use 1.9.1
|
26
30
|
spec spec/active_record/blueprints_spec.rb
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blueprints
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 2
|
10
|
+
version: 0.7.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrius Chamentauskas
|
@@ -67,6 +67,9 @@ files:
|
|
67
67
|
- VERSION
|
68
68
|
- bin/blueprintify
|
69
69
|
- blueprints.gemspec
|
70
|
+
- features/blueprints.feature
|
71
|
+
- features/step_definitions/blueprints_steps.rb
|
72
|
+
- features/support/env.rb
|
70
73
|
- init.rb
|
71
74
|
- install.rb
|
72
75
|
- lib/blueprints.rb
|
@@ -78,6 +81,7 @@ files:
|
|
78
81
|
- lib/blueprints/convertable/fixtures.rb
|
79
82
|
- lib/blueprints/database_backends/active_record.rb
|
80
83
|
- lib/blueprints/errors.rb
|
84
|
+
- lib/blueprints/extensions/cucumber.rb
|
81
85
|
- lib/blueprints/extensions/deprecated.rb
|
82
86
|
- lib/blueprints/extensions/rspec.rb
|
83
87
|
- lib/blueprints/extensions/test_unit.rb
|