ruby-changes:46479
From: eregon <ko1@a...>
Date: Sun, 7 May 2017 21:17:26 +0900 (JST)
Subject: [ruby-changes:46479] eregon:r58598 (trunk): Rename spec/README to spec/README.md
eregon 2017-05-07 21:17:21 +0900 (Sun, 07 May 2017) New Revision: 58598 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58598 Log: Rename spec/README to spec/README.md Added files: trunk/spec/README.md Removed files: trunk/spec/README Index: spec/README =================================================================== --- spec/README (revision 58597) +++ spec/README (nonexistent) @@ -1,79 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/spec/README#L0 -# ruby/spec - -ruby/spec (https://github.com/ruby/spec/) is -a test suite for the Ruby language. - -Once a month, @eregon merges the in-tree copy under spec/rubyspec -with the upstream repository, preserving the commits and history. -The same happens for other implementations such as JRuby and TruffleRuby. - -Feel welcome to modify the in-tree spec/rubyspec. -This is the purpose of the in-tree copy, -to facilitate contributions to ruby/spec for MRI developers. - -New features, additional tests for existing features and -regressions tests are all welcome in ruby/spec. -There is very little behavior that is implementation-specific, -as in the end user programs tend to rely on every behavior MRI exhibits. -In other words: If adding a spec might reveal a bug in -another implementation, then it is worth adding it. -Currently, the only module which is MRI-specific is `RubyVM`. - -## Runing ruby/spec - -To run all specs: -```bash -make test-rubyspec -``` - -Extra arguments can be added via `MSPECOPT`. -For instance, to show the help: -```bash -make test-rubyspec MSPECOPT=-h -``` - -You can also run the specs in parallel, which is currently experimental. -It takes around 10s instead of 60s on a quad-core laptop. -```bash -make test-rubyspec MSPECOPT=-j -``` - -To run a specific test, add its path to the command: -```bash -make test-rubyspec MSPECOPT=spec/rubyspec/language/for_spec.rb -``` - -If ruby trunk is your current `ruby` in `$PATH`, you can also run `mspec` directly: -```bash -# change ruby to trunk -ruby -v # => trunk -spec/mspec/bin/mspec spec/rubyspec/language/for_spec.rb -``` - -## ruby/spec and test/ - -The main difference between a "spec" under spec/rubyspec and -a test under test/ is that specs are documenting what they test. -This is extremely valuable when reading these tests, as it -helps to quickly understand what specific behavior is tested, -and how a method should behave. Basic English is fine for spec descriptions. -Specs also tend to have few expectations (assertions) per spec, -as they specify one aspect of the behavior and not everything at once. -Beyond that, the syntax is slightly different but it does the same thing: -`assert_equal 3, 1+2` is just `(1+2).should == 3`. - -Example: - -```ruby -describe "The for expression" do - it "iterates over an Enumerable passing each element to the block" do - j = 0 - for i in 1..3 - j += i - end - j.should == 6 - end -end -``` - -For more details, see spec/rubyspec/CONTRIBUTING.md. Property changes on: spec/README ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -LF \ No newline at end of property Index: spec/README.md =================================================================== --- spec/README.md (nonexistent) +++ spec/README.md (revision 58598) @@ -0,0 +1,79 @@ https://github.com/ruby/ruby/blob/trunk/spec/README.md#L1 +# ruby/spec + +ruby/spec (https://github.com/ruby/spec/) is +a test suite for the Ruby language. + +Once a month, @eregon merges the in-tree copy under spec/rubyspec +with the upstream repository, preserving the commits and history. +The same happens for other implementations such as JRuby and TruffleRuby. + +Feel welcome to modify the in-tree spec/rubyspec. +This is the purpose of the in-tree copy, +to facilitate contributions to ruby/spec for MRI developers. + +New features, additional tests for existing features and +regressions tests are all welcome in ruby/spec. +There is very little behavior that is implementation-specific, +as in the end user programs tend to rely on every behavior MRI exhibits. +In other words: If adding a spec might reveal a bug in +another implementation, then it is worth adding it. +Currently, the only module which is MRI-specific is `RubyVM`. + +## Runing ruby/spec + +To run all specs: +```bash +make test-rubyspec +``` + +Extra arguments can be added via `MSPECOPT`. +For instance, to show the help: +```bash +make test-rubyspec MSPECOPT=-h +``` + +You can also run the specs in parallel, which is currently experimental. +It takes around 10s instead of 60s on a quad-core laptop. +```bash +make test-rubyspec MSPECOPT=-j +``` + +To run a specific test, add its path to the command: +```bash +make test-rubyspec MSPECOPT=spec/rubyspec/language/for_spec.rb +``` + +If ruby trunk is your current `ruby` in `$PATH`, you can also run `mspec` directly: +```bash +# change ruby to trunk +ruby -v # => trunk +spec/mspec/bin/mspec spec/rubyspec/language/for_spec.rb +``` + +## ruby/spec and test/ + +The main difference between a "spec" under spec/rubyspec and +a test under test/ is that specs are documenting what they test. +This is extremely valuable when reading these tests, as it +helps to quickly understand what specific behavior is tested, +and how a method should behave. Basic English is fine for spec descriptions. +Specs also tend to have few expectations (assertions) per spec, +as they specify one aspect of the behavior and not everything at once. +Beyond that, the syntax is slightly different but it does the same thing: +`assert_equal 3, 1+2` is just `(1+2).should == 3`. + +Example: + +```ruby +describe "The for expression" do + it "iterates over an Enumerable passing each element to the block" do + j = 0 + for i in 1..3 + j += i + end + j.should == 6 + end +end +``` + +For more details, see spec/rubyspec/CONTRIBUTING.md. Property changes on: spec/README.md ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/