Sha256: 32cb7c9078d61ffa927a23167fbfce4dae69a09fdb536fed3629a04f7c2dc324

Contents?: true

Size: 1.4 KB

Versions: 9

Compression:

Stored size: 1.4 KB

Contents

require 'spec_helper'
require 'mspec/guards'
require 'mspec/helpers'

describe Object, "#stasy when RUBY_VERSION < 1.9" do
  before :all do
    @ruby_version = Object.const_get :RUBY_VERSION

    Object.const_set :RUBY_VERSION, "1.8.7"
  end

  after :all do
    Object.const_set :RUBY_VERSION, @ruby_version
  end

  it "returns a String when passed a String" do
    stasy("nom").should == "nom"
  end

  it "returns a String when passed a Symbol" do
    stasy(:some).should == "some"
  end

  it "returns an Array of Strings when passed an Array of Strings" do
    stasy("nom", "nom").should == ["nom", "nom"]
  end

  it "returns an Array of Strings when passed an Array of Symbols" do
    stasy(:some, :thing).should == ["some", "thing"]
  end
end

describe Object, "#stasy when RUBY_VERSION >= 1.9.0" do
  before :all do
    @ruby_version = Object.const_get :RUBY_VERSION

    Object.const_set :RUBY_VERSION, "1.9.0"
  end

  after :all do
    Object.const_set :RUBY_VERSION, @ruby_version
  end

  it "returns a Symbol when passed a String" do
    stasy("nom").should == :nom
  end

  it "returns a Symbol when passed a Symbol" do
    stasy(:some).should == :some
  end

  it "returns an Array of Symbols when passed an Array of Strings" do
    stasy("some", "thing").should == [:some, :thing]
  end

  it "returns an Array of Symbols when passed an Array of Symbols" do
    stasy(:nom, :nom).should == [:nom, :nom]
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mspec-1.9.1 spec/helpers/stasy_spec.rb
mspec-1.9.0 spec/helpers/stasy_spec.rb
mspec-1.8.0 spec/helpers/stasy_spec.rb
mspec-1.7.0 spec/helpers/stasy_spec.rb
mspec-1.6.0 spec/helpers/stasy_spec.rb
mspec-1.5.21 spec/helpers/stasy_spec.rb
mspec-1.5.20 spec/helpers/stasy_spec.rb
mspec-1.5.19 spec/helpers/stasy_spec.rb
mspec-1.5.18 spec/helpers/stasy_spec.rb