css3-progress-bar-rails 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown
CHANGED
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'nokogiri'
|
3
|
+
require 'action_view'
|
4
|
+
require './app/helpers/css3_progress_bars_helper'
|
5
|
+
include ActionView::Helpers
|
6
|
+
include Css3ProgressBarsHelper
|
7
|
+
|
8
|
+
describe Css3ProgressBarsHelper do
|
9
|
+
describe '#progress_bar' do
|
10
|
+
describe 'given a percentage value' do
|
11
|
+
describe 'with the color option' do
|
12
|
+
describe 'set to an invalid color' do
|
13
|
+
it 'sets no color classes in the divs' do
|
14
|
+
doc = Nokogiri::HTML(progress_bar(55, :color => 'mauve'))
|
15
|
+
doc.search('div.bar_container').first.attributes["class"].value.wont_match /mauve_container/
|
16
|
+
doc.search('div.bar_mortice').first.attributes["class"].value.wont_match /mauve_mortice/
|
17
|
+
doc.search('div.progress').first.attributes["class"].value.wont_match /mauve/
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe 'set to a valid color' do
|
22
|
+
it 'sets the correct color classes in the divs' do
|
23
|
+
doc = Nokogiri::HTML(progress_bar(55, :color => 'blue'))
|
24
|
+
doc.search('div.bar_container').first.attributes["class"].value.must_match /blue_container/
|
25
|
+
doc.search('div.bar_mortice').first.attributes["class"].value.must_match /blue_mortice/
|
26
|
+
doc.search('div.progress').first.attributes["class"].value.must_match /blue/
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe 'with the rounded option' do
|
32
|
+
it 'sets the correct rounded classes in the divs' do
|
33
|
+
doc = Nokogiri::HTML(progress_bar(55, :rounded => true))
|
34
|
+
doc.search('div.bar_container').first.attributes["class"].value.must_match /rounded_bar_container/
|
35
|
+
doc.search('div.bar_mortice').first.attributes["class"].value.must_match /rounded/
|
36
|
+
doc.search('div.progress').first.attributes["class"].value.must_match /rounded/
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe 'with the tiny option' do
|
41
|
+
it 'sets the correct tiny classes in the divs' do
|
42
|
+
doc = Nokogiri::HTML(progress_bar(55, :tiny => true))
|
43
|
+
doc.search('div.bar_container').first.attributes["class"].value.must_match /container_tiny/
|
44
|
+
doc.search('div.bar_mortice').first.attributes["class"].value.must_match /mortice_tiny/
|
45
|
+
doc.search('div.progress').first.attributes["class"].value.must_match /progress_tiny/
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
describe 'with no options' do
|
50
|
+
it 'returns the correct number of divs' do
|
51
|
+
Nokogiri::HTML(progress_bar(3)).search('div').count.must_be :==, 3
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'sets the correct style in the progress div' do
|
55
|
+
Nokogiri::HTML(progress_bar(44)).search('div.progress').first.attributes["style"].value.must_be :==, "width: 44%;"
|
56
|
+
Nokogiri::HTML(progress_bar(88)).search('div.progress').first.attributes["style"].value.must_be :==, "width: 88%;"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
metadata
CHANGED
@@ -1,39 +1,57 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: css3-progress-bar-rails
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
4
5
|
prerelease:
|
5
|
-
version: 0.1.1
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Nicholas Fine
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-01-03 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
17
15
|
name: rails
|
18
|
-
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &10655340 !ruby/object:Gem::Requirement
|
20
17
|
none: false
|
21
|
-
requirements:
|
22
|
-
- -
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version:
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
25
22
|
type: :runtime
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *10655340
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: minitest
|
27
|
+
requirement: &10654880 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *10654880
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: nokogiri
|
38
|
+
requirement: &10654300 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *10654300
|
47
|
+
description: Integrates Josh Sullivan's CSS3 Progress Bars into Rails and adds ActionView
|
48
|
+
helpers for generation.
|
49
|
+
email:
|
29
50
|
- nicholas.fine@gmail.com
|
30
51
|
executables: []
|
31
|
-
|
32
52
|
extensions: []
|
33
|
-
|
34
53
|
extra_rdoc_files: []
|
35
|
-
|
36
|
-
files:
|
54
|
+
files:
|
37
55
|
- .gitignore
|
38
56
|
- Gemfile
|
39
57
|
- README.markdown
|
@@ -43,33 +61,29 @@ files:
|
|
43
61
|
- css3-progress-bar-rails.gemspec
|
44
62
|
- lib/css3-progress-bar-rails.rb
|
45
63
|
- lib/css3-progress-bar-rails/version.rb
|
46
|
-
|
47
|
-
homepage:
|
64
|
+
- test/css3_progress_bars_helper_test.rb
|
65
|
+
homepage: ''
|
48
66
|
licenses: []
|
49
|
-
|
50
67
|
post_install_message:
|
51
68
|
rdoc_options: []
|
52
|
-
|
53
|
-
require_paths:
|
69
|
+
require_paths:
|
54
70
|
- lib
|
55
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
72
|
none: false
|
57
|
-
requirements:
|
58
|
-
- -
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version:
|
61
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
78
|
none: false
|
63
|
-
requirements:
|
64
|
-
- -
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version:
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
67
83
|
requirements: []
|
68
|
-
|
69
84
|
rubyforge_project: css3-progress-bar-rails
|
70
|
-
rubygems_version: 1.
|
85
|
+
rubygems_version: 1.8.10
|
71
86
|
signing_key:
|
72
87
|
specification_version: 3
|
73
88
|
summary: Integrates Josh Sullivan's CSS3 Progress Bars into Rails 3.1+ Projects.
|
74
89
|
test_files: []
|
75
|
-
|