Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added more specs #1038

Merged
merged 20 commits into from

5 participants

@flavio

Improve rubyspec coverage.

@brixen brixen was assigned
@headius

A question: should specs be committed to Rubinius or to RubySpec? I would have thought the latter, even though Rubinius's copy gets periodically merged back. Commits directly would then be immediately accessible by all implementations, rather than waiting for the merge.

@flavio

Good question. I'm new to the rubinius project, so I'm eager to know what is the preferred approach.

@flavio

Stupid typo, it's not 'core' refactoring but 'code'. Excuse me...

@flavio flavio Core refactoring: follow rubyspec coding guidelines
Put utility class into a special module in order to avoid name clashes.
251b9f5
@brixen
Owner

This is the procedure we request people follow when writing specs for making changes to Rubinius http://rubini.us/doc/en/specs/.

Commits can be submitted to RubySpec directly also, but we expect to see passing specs or CI tags removed for commits to Rubinius and the above procedure has the least friction for all parties.

@Charlie, if you're concerned about the availability of the specs in RubySpec, request that I sync them if I'm behind on that.

@headius

In this case, it seems the specs are just being added to fill out RubySpec, so perhaps it's better to just commit to RubySpec.

I understand that fixes to Rubinius, when accompanied by spec changes, will go into Rubinius as two commits with the spec change later merged back to RubySpec. That's fine. But spec additions/changes separate from Rubinius work have always gone into RubySpec, and I think that should continue. Agreed?

@flavio

As discussed on irc I'll fix the File::Stat specs as soon as @brixen commits an example.

@travisbot

This pull request passes (merged 37a12ae into d6ac366).

@travisbot

This pull request passes (merged 0de4dd8 into 7f24eb5).

@travisbot

This pull request passes (merged 4e6f815 into c4fe2ec).

@Peeja

A wild triage fairy appears!

@flavio, are you still waiting on @brixen's example?

@brixen
Owner

@Peeja I'll be adding some shortly.

@flavio
@brixen brixen merged commit 5c34664 into rubinius:master
@brixen brixen referenced this pull request from a commit
@brixen brixen Updated rubygems to 2.4.5.
RubyGems 2.4.5 installed

=== 2.4.5 / 2014-12-03

Bug fixes:

* Improved speed of requiring gems.  (Around 25% for a 60 gem test).  Pull
  request #1060 by unak.
* RubyGems no longer attempts to look up gems remotely with the --local flag.
  Pull request #1084 by Jeremy Evans.
* Executable stubs use the correct gem version when RUBYGEMS_GEMDEPS is
  active.  Issue #1072 by Michael Kaiser-Nyman.
* Fixed handling of pinned gems in lockfiles with versions.  Issue #1078 by
  Ian Ker-Seymer.
* Fixed handling of git@example:gem.git URIs.  Issue #1054 by Mogutan Mogu.
* Fixed handling of platforms retrieved from the dependencies API.  Issue
  #1058 and patch suggestion by tux-mind.
* RubyGems now suggests a copy-pasteable `gem pristine` command when
  extensions are missing.  Pull request #1057 by Shannon Skipper.
* Improved errors for long file names when packaging.  Pull request #1016 by
  Piotrek Bator.
* `gem pristine` now skips gems cannot be found remotely.  Pull request #1064
  by Tuomas Kareinen.
* `gem pristine` now caches gems to the proper directory.  Pull request #1064
  by Tuomas Kareinen.
* `gem pristine` now skips bundled gems properly.  Pull request #1064 by
  Tuomas Kareinen.
* Improved interoperability of Vagrant with RubyGems.  Pull request #1057 by
  Vít Ondruch.
* Renamed CONTRIBUTING to CONTRIBUTING.rdoc to allow markup.  Pull request
  #1090 by Roberto Miranda.
* Switched from #partition to #reject as only one collection is used.  Pull
  request #1074 by Tuomas Kareinen.
* Fixed installation of gems on systems using memory-mapped files.  Pull
  request #1038 by Justin Li.
* Fixed bug in Gem::Text#min3 where `a == b < c`.  Pull request #1026 by
  fortissimo1997.
* Fixed uninitialized variable warning in BasicSpecification.  Pull request
  #1019 by Piotr Szotkowski.
* Removed unneeded exception handling for cyclic dependencies.  Pull request
  #1043 by Jens Wille.
* Fixed grouped expression warning.  Pull request #1081 by André Arko.
* Fixed handling of platforms when writing lockfiles.

=== 2.4.4 / 2014-11-12
891d9dc
@brixen brixen referenced this pull request from a commit
@brixen brixen Updated RubyGems to 2.4.6.
RubyGems 2.4.6 installed

=== 2.4.6 / 2014-02-05

Bug fixes:

* Fixed resolving gems with both upper and lower requirement boundaries.
  Issue #1141 by Jakub Jirutka.
* Moved extension directory after require_paths to fix missing constant bugs
  in some gems with C extensions.  Issue #784 by André Arko, pull request
  #1137 by Barry Allard.
* Use Gem::Dependency#requirement when adding a dependency to an existing
  dependency instance.  Pull request #1101 by Josh Cheek.
* Fixed warning of shadowed local variable in Gem::Specification.  Pull request
  #1109 by Rohit Arondekar
* Gem::Requirement should always sort requirements before coercion to Hash.
  Pull request #1139 by Eito Katagiri.
* The `gem open` command should change the current working directory before
  opening the editor.  Pull request #1142 by Alex Wood.
* Ensure quotes are stripped from the Windows launcher script used to install
  gems.  Pull request #1115 by Youngjun Song.
* Fixed errors when writing to NFS to to 0444 files.  Issue #1161 by Emmanuel
  Hadoux.
* Removed dead code in Gem::StreamUI.  Pull request #1117 by mediaslave24.
* Fixed typos.  Pull request #1096 by hakeda.
* Relaxed CMake dependency for RHEL 6 and CentOS 6.  Pull request #1124 by Vít
  Ondruch.
* Relaxed Psych dependency.  Pull request #1128 by Vít Ondruch.

=== 2.4.5 / 2014-12-03

Bug fixes:

* Improved speed of requiring gems.  (Around 25% for a 60 gem test).  Pull
  request #1060 by unak.
* RubyGems no longer attempts to look up gems remotely with the --local flag.
  Pull request #1084 by Jeremy Evans.
* Executable stubs use the correct gem version when RUBYGEMS_GEMDEPS is
  active.  Issue #1072 by Michael Kaiser-Nyman.
* Fixed handling of pinned gems in lockfiles with versions.  Issue #1078 by
  Ian Ker-Seymer.
* Fixed handling of git@example:gem.git URIs.  Issue #1054 by Mogutan Mogu.
* Fixed handling of platforms retrieved from the dependencies API.  Issue
  #1058 and patch suggestion by tux-mind.
* RubyGems now suggests a copy-pasteable `gem pristine` command when
  extensions are missing.  Pull request #1057 by Shannon Skipper.
* Improved errors for long file names when packaging.  Pull request #1016 by
  Piotrek Bator.
* `gem pristine` now skips gems cannot be found remotely.  Pull request #1064
  by Tuomas Kareinen.
* `gem pristine` now caches gems to the proper directory.  Pull request #1064
  by Tuomas Kareinen.
* `gem pristine` now skips bundled gems properly.  Pull request #1064 by
  Tuomas Kareinen.
* Improved interoperability of Vagrant with RubyGems.  Pull request #1057 by
  Vít Ondruch.
* Renamed CONTRIBUTING to CONTRIBUTING.rdoc to allow markup.  Pull request
  #1090 by Roberto Miranda.
* Switched from #partition to #reject as only one collection is used.  Pull
  request #1074 by Tuomas Kareinen.
* Fixed installation of gems on systems using memory-mapped files.  Pull
  request #1038 by Justin Li.
* Fixed bug in Gem::Text#min3 where `a == b < c`.  Pull request #1026 by
  fortissimo1997.
* Fixed uninitialized variable warning in BasicSpecification.  Pull request
  #1019 by Piotr Szotkowski.
* Removed unneeded exception handling for cyclic dependencies.  Pull request
  #1043 by Jens Wille.
* Fixed grouped expression warning.  Pull request #1081 by André Arko.
* Fixed handling of platforms when writing lockfiles.

------------------------------------------------------------------------------
c3b4f95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 21, 2011
  1. @flavio

    Add spec for File::Stat.setgid?

    flavio authored
  2. @flavio

    Add spec for File::Stat.setuid?

    flavio authored
  3. @flavio

    Add spec for File::Stat.socket?

    flavio authored
  4. @flavio

    Add spec for File::Stat.sticky?

    flavio authored
  5. @flavio
  6. @flavio
Commits on Jun 22, 2011
  1. @flavio

    Core refactoring: follow rubyspec coding guidelines

    flavio authored
    Put utility class into a special module in order to avoid name clashes.
Commits on Oct 19, 2011
  1. @flavio
Commits on Oct 20, 2011
  1. @flavio
Commits on Oct 31, 2011
  1. @flavio
Commits on Nov 9, 2011
  1. @flavio
Commits on Nov 10, 2011
  1. @flavio
Commits on Nov 17, 2011
  1. @flavio
Commits on Nov 18, 2011
  1. @flavio
Commits on Nov 25, 2011
  1. Merge remote-tracking branch 'upstream/master'

    Flavio Castelli authored
Commits on Jan 31, 2012
  1. @flavio
Commits on Mar 7, 2012
  1. @flavio
Commits on Apr 26, 2012
  1. @flavio
Commits on May 2, 2012
  1. @flavio
Commits on May 3, 2012
  1. @flavio
This page is out of date. Refresh to see the latest.
View
23 spec/ruby/core/file/stat/setgid_spec.rb
@@ -7,5 +7,26 @@
end
describe "File::Stat#setgid?" do
- it "needs to be reviewed for spec completeness"
+ before(:each) do
+ @name = tmp('test.txt')
+ touch @name
+ end
+
+ after(:each) do
+ rm_r @name
+ end
+
+ it "returns false if the file was just made" do
+ st = File.stat(@name)
+ st.setgid?.should == false
+ end
+
+ platform_is_not :windows do
+ it "returns true when the gid bit is set" do
+ system "chmod g+s #{@name}"
+
+ st = File.stat(@name)
+ st.setgid?.should == true
+ end
+ end
end
View
24 spec/ruby/core/file/stat/setuid_spec.rb
@@ -7,5 +7,27 @@
end
describe "File::Stat#setuid?" do
- it "needs to be reviewed for spec completeness"
+ before(:each) do
+ @name = tmp('test.txt')
+ touch @name
+ end
+
+ after(:each) do
+ rm_r @name
+ end
+
+ it "returns false if the file was just made" do
+ st = File.stat(@name)
+ st.setuid?.should == false
+ end
+
+ platform_is_not :windows do
+ it "returns true when the gid bit is set" do
+ system "chmod u+s #{@name}"
+
+ st = File.stat(@name)
+ st.setuid?.should == true
+ end
+ end
+
end
View
22 spec/ruby/core/file/stat/socket_spec.rb
@@ -1,11 +1,31 @@
require File.expand_path('../../../../spec_helper', __FILE__)
require File.expand_path('../../../../shared/file/socket', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
+require 'socket'
describe "File::Stat#socket?" do
it_behaves_like :file_socket, :socket?, FileStat
end
describe "File::Stat#socket?" do
- it "needs to be reviewed for spec completeness"
+ it "returns false if the file is not a socket" do
+ filename = tmp("i_exist")
+ touch(filename)
+
+ st = File.stat(filename)
+ st.socket?.should == false
+
+ rm_r filename
+ end
+
+ it "returns true if the file is a socket" do
+ filename = tmp("i_am_a_socket")
+ server = UNIXServer.new filename
+
+ st = File.stat(filename)
+ st.socket?.should == true
+
+ rm_r filename
+ end
+
end
View
22 spec/ruby/core/file/stat/sticky_spec.rb
@@ -7,5 +7,25 @@
end
describe "File::Stat#sticky?" do
- it "needs to be reviewed for spec completeness"
+ before(:each) do
+ @filename = tmp("i_exist")
+ touch(@filename)
+ end
+
+ after(:each) do
+ rm_r @filename
+ end
+
+ it "returns false if the file has not sticky bit set" do
+ st = File.stat(@filename)
+ st.sticky?.should == false
+ end
+
+ platform_is_not :windows do
+ it "returns true if the file has sticky bit set" do
+ system "chmod +t #{@filename}"
+ st = File.stat(@filename)
+ st.sticky?.should == true
+ end
+ end
end
View
25 spec/ruby/core/file/sticky_spec.rb
@@ -7,28 +7,27 @@
end
describe "File.sticky?" do
+ before(:each) do
+ @filename = tmp("i_exist")
+ touch(@filename)
+ end
+
+ after(:each) do
+ rm_r @filename
+ end
+
it "returns false if file does not exist" do
File.sticky?("I_am_a_bogus_file").should == false
end
it "returns false if the file has not sticky bit set" do
- filename = tmp("i_exist")
- touch(filename)
-
- File.sticky?(filename).should == false
-
- rm_r filename
+ File.sticky?(@filename).should == false
end
platform_is :linux, :darwin do
it "returns true if the file has sticky bit set" do
- filename = tmp("i_exist")
- touch(filename)
- system "chmod +t #{filename}"
-
- File.sticky?(filename).should == true
-
- rm_r filename
+ system "chmod +t #{@filename}"
+ File.sticky?(@filename).should == true
end
end
View
21 spec/ruby/core/kernel/instance_variable_defined_spec.rb
@@ -1,5 +1,24 @@
require File.expand_path('../../../spec_helper', __FILE__)
+module KernelSpec
+ class Foo
+ def initialize
+ @bar = 'this is an instance variable'
+ end
+ end
+end
+
describe "Kernel#instance_variable_defined?" do
- it "needs to be reviewed for spec completeness"
+ it 'returns false if the instance variable is not defined' do
+ foo = KernelSpec::Foo.new
+ foo.instance_variable_defined?("@foo").should == false
+ foo.instance_variable_defined?(:@foo).should == false
+ end
+
+ it 'returns true if the instance variable is defined' do
+ foo = KernelSpec::Foo.new
+ foo.instance_variable_defined?("@bar").should == true
+ foo.instance_variable_defined?(:@bar).should == true
+ end
+
end
Something went wrong with that request. Please try again.