Changeset 6558

Show
Ignore:
Timestamp:
02/11/08 18:09:12 (5 years ago)
Author:
walf443
Message:

lang/ruby/rspec-fixture:

  • updated ChangeLog? from svk log
  • added document for Spec::Fixture::Base's each methods.
Location:
lang/ruby/rspec-fixture/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/rspec-fixture/trunk/ChangeLog

    r6363 r6558  
    1 == 0.0.1 / 2008-02-08 
     1---------------------------------------------------------------------- 
     2r3507 (orig r6556):  walf443 | 2008-02-11 17:34:20 +0900 
    23 
    3 * initial release 
     4lang/ruby/rspec-fixture: added DESCRIPTION for Rakefile 
     5---------------------------------------------------------------------- 
     6r3505 (orig r6554):  walf443 | 2008-02-11 17:23:32 +0900 
    47 
     8lang/ruby/rspec-fixture: wrote README 
     9---------------------------------------------------------------------- 
     10r3502 (orig r6551):  walf443 | 2008-02-11 16:34:52 +0900 
     11 
     12lang/ruby/rspec-fixture: fix example's output message 
     13---------------------------------------------------------------------- 
     14r3490 (orig r6539):  walf443 | 2008-02-11 13:04:48 +0900 
     15 
     16lang/ruby/rspec-fixture:  
     17  - fix a bug that is 'not converting collectly :msg in description template'.  
     18  - add spec-fixture-base spec. 
     19---------------------------------------------------------------------- 
     20r3475 (orig r6524):  walf443 | 2008-02-11 01:08:54 +0900 
     21 
     22lang/ruby/rspec-fixture: generated class with filter should behave like 'generated_class' 
     23---------------------------------------------------------------------- 
     24r3474 (orig r6523):  walf443 | 2008-02-11 01:07:59 +0900 
     25 
     26lang/ruby/rspec-fixture: load library  not in each spec file, but spec_helper.rb. 
     27---------------------------------------------------------------------- 
     28r3473 (orig r6522):  walf443 | 2008-02-11 00:59:39 +0900 
     29 
     30lang/ruby/rspec-fixture: delete extra file and change to load library in shared helper. 
     31---------------------------------------------------------------------- 
     32r3472 (orig r6521):  walf443 | 2008-02-11 00:57:32 +0900 
     33 
     34lang/ruby/rspec-fixture: add _define_fixture spec and fix some bug. 
     35---------------------------------------------------------------------- 
     36r3471 (orig r6520):  walf443 | 2008-02-11 00:30:29 +0900 
     37 
     38lang/ruby/rspc-fixture: fix spec task for executing coverage test collectly. 
     39---------------------------------------------------------------------- 
     40r3453 (orig r6502):  walf443 | 2008-02-10 18:52:37 +0900 
     41 
     42lang/ruby/rspec-fixture: add spec for with_fixture method 
     43---------------------------------------------------------------------- 
     44r3415 (orig r6464):  walf443 | 2008-02-10 05:02:25 +0900 
     45 
     46lang/ruby/rspec-fixture: 
     47 - support desc_filters for customizing description flexibly. 
     48 - change desc_template value to use raw input value's inspect 
     49---------------------------------------------------------------------- 
     50r3408 (orig r6457):  walf443 | 2008-02-10 01:39:04 +0900 
     51 
     52lang/ruby/rspec-fixture:  
     53 - raise NameError when with_fixtures arg duplicate to reserved name. 
     54 - just use msg when description template was not exist. 
     55---------------------------------------------------------------------- 
     56r3404 (orig r6453):  walf443 | 2008-02-10 00:06:50 +0900 
     57 
     58lang/ruby/rspec-fixture: support filters, spec template for description 
     59---------------------------------------------------------------------- 
     60r3314 (orig r6363):  walf443 | 2008-02-08 09:42:35 +0900 
     61 
     62lang/ruby/rspec-fixture: import new project. 
     63---------------------------------------------------------------------- 
  • lang/ruby/rspec-fixture/trunk/lib/spec/fixture/base.rb

    r6539 r6558  
    1212  end 
    1313 
     14  # This &example block was iterate as example by each fixture. 
     15  # when you specify description for example,  
     16  # you can use ":" started string as template variable. 
     17  # Template variable is expand to raw value's inspect in default  
     18  # expect for :msg. If you customize output message,  
     19  # please use +desc_filters+. 
     20  #  
     21  # Block should take argumentes in order input, expected. 
     22  # input was a Hash in input has two or larger members.  
     23  # When input has only a member, input has filtered value. 
    1424  def it desc=nil, &example 
    1525    if desc 
     
    1929  end 
    2030 
     31  # You specify test data in this methods. 
     32  # Argument should be Array that has a Hash (and string optionaly). 
     33  # In Hasy key, you write input data and in its value you write expected data. 
    2134  def set_fixtures data 
    2235    @fixtures = data.map do |item| 
     
    2740  end 
    2841 
     42  # If you specify +filters+, you can use filtered value in +it+'s block 
     43  # filters argument is hash that has a key of members. 
     44  # value should be string or symbol or Array that contain strings or symbols or Proc. 
     45  # In case value is Proc, filtered value is Proc's result. 
     46  # In case value is Array, each item was applyed using Object#__send__. 
     47  # In case value is string or symbol, same the above. 
    2948  def filters hash 
    3049    @filter_of = hash 
    3150  end 
    3251 
     52  # If you customize specify for example, you should use this method. 
     53  # This methods's usage is the same as +filters+. 
    3354  def desc_filters hash 
    3455    @desc_filter_of = hash 
    3556  end 
    3657 
    37   def generate_msg fxt 
     58  def generate_msg fxt #:nodoc: 
    3859    if @desc_template 
    3960      msg = @desc_template 
     
    6889  end 
    6990 
    70   def run 
     91  def run #:nodoc: 
    7192    fixture = self 
    7293    @binding.module_eval do 
     
    82103 
    83104  # generate temp class for fixture. 
    84   def _define_fixture input, expected 
     105  def _define_fixture input, expected #:nodoc: 
    85106    klass = Class.new 
    86107    klass.class_eval do