attrtastic 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,50 +2,54 @@ require 'helper'
2
2
 
3
3
  class TestSemanticAttributesHelper < Test::Unit::TestCase
4
4
 
5
- def setup
6
- setup_fixtures
7
- end
5
+ context "semantic_attributes_helper" do
8
6
 
9
- def test__semantic_attributes_for__output_with_no_block
10
- expected = html <<-EOHTML
11
- <div class="attrtastic user">
12
- </div>
13
- EOHTML
7
+ setup do
8
+ setup_fixtures
9
+ end
14
10
 
15
- @template.semantic_attributes_for(@user)
16
- actual = @template.output_buffer.to_s
17
- assert_equal expected, actual
11
+ should "generate output event when no block given" do
12
+ expected = html <<-EOHTML
13
+ <div class="attrtastic user">
14
+ </div>
15
+ EOHTML
18
16
 
19
- @template.output_buffer.clear
17
+ @template.semantic_attributes_for(@user)
18
+ actual = @template.output_buffer.to_s
19
+ assert_equal expected, actual
20
20
 
21
- expected = html <<-EOHTML
22
- <div class="attrtastic blog">
23
- </div>
24
- EOHTML
21
+ @template.output_buffer.clear
25
22
 
26
- @template.semantic_attributes_for(@blog)
27
- actual = @template.output_buffer.to_s
28
- assert_equal expected, actual
29
- end
23
+ expected = html <<-EOHTML
24
+ <div class="attrtastic blog">
25
+ </div>
26
+ EOHTML
30
27
 
31
- def test__semantic_attributes_for__should_run_block
32
- block_run = false
33
- @template.semantic_attributes_for(@user) do |attr|
34
- block_run = true
28
+ @template.semantic_attributes_for(@blog)
29
+ actual = @template.output_buffer.to_s
30
+ assert_equal expected, actual
35
31
  end
36
32
 
37
- assert block_run
38
- end
33
+ should "run block" do
34
+ block_run = false
35
+ @template.semantic_attributes_for(@user) do |attr|
36
+ block_run = true
37
+ end
39
38
 
40
- def test__semantic_attributes_for__with_options
41
- expected = html <<-EOHTML
42
- <div class="attrtastic user simple show">
43
- </div>
44
- EOHTML
39
+ assert block_run
40
+ end
41
+
42
+ should "accept options" do
43
+ expected = html <<-EOHTML
44
+ <div class="attrtastic user simple show">
45
+ </div>
46
+ EOHTML
47
+
48
+ @template.semantic_attributes_for(@user, :html => {:class => 'simple show'})
49
+ actual = @template.output_buffer.to_s
50
+ assert_equal expected, actual
51
+ end
45
52
 
46
- @template.semantic_attributes_for(@user, :html => {:class => 'simple show'})
47
- actual = @template.output_buffer.to_s
48
- assert_equal expected, actual
49
53
  end
50
54
 
51
55
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attrtastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boruta Miroslaw
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-11 00:00:00 +01:00
12
+ date: 2010-01-15 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -22,6 +22,16 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: "0"
24
24
  version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: shoulda
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
25
35
  description: " Attrtastic, in its assumtion, should be similar in usage to formtastic and\n ease of displaying AR record informations (attributes). It should help\n scafforld show/index pages.\n"
26
36
  email: boruta.miroslaw@gmail.com
27
37
  executables: []