Permalink
Browse files

Reorganize test folder

  • Loading branch information...
1 parent ba1d0fc commit 22f108610b3fb5c7214e3065d8696fe584d403c4 @rrrene committed Jan 29, 2014
Showing with 31 additions and 25 deletions.
  1. +1 −1 test/{ → sparkr}/cli_test.rb
  2. +30 −0 test/sparkr/sparkline_test.rb
  3. +0 −24 test/sparkr_test.rb
View
2 test/cli_test.rb → test/sparkr/cli_test.rb
@@ -1,6 +1,6 @@
# encoding: utf-8
-require File.expand_path(File.dirname(__FILE__) + '/test_helper')
+require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
describe ::Sparkr::CLI do
it "should find work" do
View
30 test/sparkr/sparkline_test.rb
@@ -0,0 +1,30 @@
+# encoding: utf-8
+
+require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
+
+describe ::Sparkr::Sparkline do
+
+ it "format should work with arity == 2" do
+ sparkline = Sparkr::Sparkline.new([5.5,20])
+ sparkline.format do |tick, number|
+ if number < 6.0
+ tick = tick + "-"
+ else
+ tick
+ end
+ end
+ assert_equal '▁-█', sparkline.to_s
+ end
+
+ it "format should work with arity == 3" do
+ sparkline = Sparkr::Sparkline.new([5.5,20])
+ sparkline.format do |tick, number, index|
+ if index == 1
+ tick = tick + "-"
+ else
+ tick
+ end
+ end
+ assert_equal '▁█-', sparkline.to_s
+ end
+end
View
24 test/sparkr_test.rb
@@ -17,28 +17,4 @@
it "should find work with equal numbers" do
assert_sparkline '▁▁', [10, 10]
end
-
- it "format should work with arity == 2" do
- sparkline = Sparkr::Sparkline.new([5.5,20])
- sparkline.format do |tick, number|
- if number < 6.0
- tick = tick + "-"
- else
- tick
- end
- end
- assert_equal '▁-█', sparkline.to_s
- end
-
- it "format should work with arity == 3" do
- sparkline = Sparkr::Sparkline.new([5.5,20])
- sparkline.format do |tick, number, index|
- if index == 1
- tick = tick + "-"
- else
- tick
- end
- end
- assert_equal '▁█-', sparkline.to_s
- end
end

0 comments on commit 22f1086

Please sign in to comment.