simpex 0.0.3 → 0.0.4
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/.gitignore +3 -0
- data/lib/simpex/type.rb +1 -1
- data/lib/simpex/version.rb +1 -1
- data/test/test_type.rb +9 -0
- metadata +3 -2
data/.gitignore
ADDED
data/lib/simpex/type.rb
CHANGED
@@ -23,7 +23,7 @@ class Type
|
|
23
23
|
else
|
24
24
|
@attributes << attribute
|
25
25
|
if attribute =~ /^\$/
|
26
|
-
if @macros.empty? || @macros.none?{|m| m.split("=").first == attribute}
|
26
|
+
if @macros.empty? || @macros.none?{|m| m.split("=").first == attribute.split("[").first}
|
27
27
|
raise ArgumentError.new "You are using a macro that is not defined: #{attribute}, declared macros are #{@macros}"
|
28
28
|
end
|
29
29
|
end
|
data/lib/simpex/version.rb
CHANGED
data/test/test_type.rb
CHANGED
@@ -38,6 +38,15 @@ class TestType < Test::Unit::TestCase
|
|
38
38
|
Type.new("Product", %w{code[unique=true] name[lang=en] name[lang=de] unit(code) $catalogVersion supercategories(code)}, macros)
|
39
39
|
end
|
40
40
|
|
41
|
+
def test_type_should_validate_the_presence_of_macros_handling_the_unique_propery
|
42
|
+
assert_raises ArgumentError do
|
43
|
+
Type.new("Product", %w{code[unique=true] name[lang=en] name[lang=de] unit(code) $catalogVersion supercategories(code)})
|
44
|
+
end
|
45
|
+
|
46
|
+
macros = ["$catalogVersion=adsfasdfasdf"]
|
47
|
+
Type.new("Product", %w{code[unique=true] name[lang=en] name[lang=de] unit(code) $catalogVersion[unique=true] supercategories(code)}, macros)
|
48
|
+
end
|
49
|
+
|
41
50
|
def test_shoud_add_an_after_each_statement
|
42
51
|
bash_script = "#%afterEach: "
|
43
52
|
after_each = "impex.getLastImportedItem().setApprovalStatus(impex.getLastImportedItem().getBaseProduct().getApprovalStatus());"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simpex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-25 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: Read more details at the homepage https://github.com/denislutz/simpex
|
15
15
|
email:
|
@@ -19,6 +19,7 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- .bundle/config
|
22
|
+
- .gitignore
|
22
23
|
- .rvmrc
|
23
24
|
- Gemfile
|
24
25
|
- Gemfile.lock
|