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.
@@ -12,7 +12,8 @@ Thought it might be useful.
12
12
 
13
13
  This gem assumes you're using Rails 3.1+, including the asset pipeline.
14
14
 
15
- Into the Gemfile:
15
+ Into the Gemfile:
16
+
16
17
  gem 'css3-progress-bar-rails'
17
18
 
18
19
  Into the application.css header:
@@ -21,4 +21,6 @@ Gem::Specification.new do |s|
21
21
  # specify any dependencies here; for example:
22
22
  # s.add_development_dependency "rspec"
23
23
  s.add_runtime_dependency "rails"
24
+ s.add_development_dependency "minitest"
25
+ s.add_development_dependency "nokogiri"
24
26
  end
@@ -2,7 +2,7 @@ module Css3
2
2
  module Progress
3
3
  module Bar
4
4
  module Rails
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
8
8
  end
@@ -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
- date: 2012-01-02 00:00:00 -06:00
14
- default_executable:
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
- prerelease: false
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: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
25
22
  type: :runtime
26
- version_requirements: *id001
27
- description: Integrates Josh Sullivan's CSS3 Progress Bars into Rails and adds ActionView helpers for generation.
28
- email:
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
- has_rdoc: true
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: "0"
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: "0"
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.6.2
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
-