simpex 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ pkg
2
+ doc
3
+ Manifest
@@ -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
@@ -1,4 +1,4 @@
1
1
  module Simpex
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
4
4
 
@@ -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.3
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-23 00:00:00.000000000Z
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