djsun-context 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,4 +26,5 @@ test/test_helper.rb
26
26
  test/test_lifecycle.rb
27
27
  test/test_nested_lifecycle.rb
28
28
  test/test_shared.rb
29
+ test/test_shared_lifecycle.rb
29
30
  test/test_test.rb
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "context"
3
- s.version = "0.5.5"
3
+ s.version = "0.5.6"
4
4
  s.date = "2008-10-03"
5
5
  s.summary = "Contexts and DSL sugar for your tests"
6
6
  s.email = "jeremy@entp.com"
@@ -2,7 +2,7 @@ class String
2
2
  # Replaces spaces and tabs with _ so we can use the string as a method name
3
3
  # Also replace dangerous punctuation
4
4
  def to_method_name
5
- self.downcase.gsub(/[\s:',\.~;!#=\(\)&]+/,'_')
5
+ self.downcase.gsub(/[\s:',\.~;!#=\(\)&\?]+/, '_')
6
6
  end
7
7
 
8
8
  # Borrowed from +camelize+ in ActiveSupport
@@ -2,7 +2,7 @@ module Context
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- TINY = 5
5
+ TINY = 6
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -3,19 +3,23 @@ require File.dirname(__FILE__) + '/test_helper.rb'
3
3
  class TestCoreExt < Test::Unit::TestCase
4
4
  context "A string" do
5
5
  it "should be converted to method name" do
6
- assert :this_is_fun, "this is fun".to_method_name
6
+ assert_equal "this_is_fun", "this is fun".to_method_name
7
7
  end
8
8
 
9
9
  it "should be downcased when converted" do
10
- assert :this_is_a_blast, "THIS is A BlASt".to_method_name
10
+ assert_equal "this_is_a_blast", "THIS is A BlASt".to_method_name
11
11
  end
12
12
 
13
13
  it "should change spaces to _" do
14
- assert :this_has_been_great, "This has been great".to_method_name
14
+ assert_equal "this_has_been_great", "This has been great".to_method_name
15
15
  end
16
16
 
17
17
  it "should change dangerous punctuation to _" do
18
- assert :no__really__this_was__good_, "No, really; this was #good!".to_method_name
18
+ assert_equal "no_really_this_was_good_", "No, really; this was #good!".to_method_name
19
+ end
20
+
21
+ it "should change ? to _" do
22
+ assert_equal "are_you_sure_yes_", "Are you sure? Yes.".to_method_name
19
23
  end
20
24
  end
21
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: djsun-context
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy McAnally