Sha256: 4f254ecf7a7c611e79d89e84c69b9e3cb8ea07a5299a0343cacb6d8e03e7ad69

Contents?: true

Size: 536 Bytes

Versions: 48

Compression:

Stored size: 536 Bytes

Contents

require 'spec_helper'

module AttrAccessorSpec
  module M
    attr_accessor :foo
  end

  class C
    include M
  end
end

describe "Module#attr_accessor" do
  it "can be passed a splat of arguments" do
    eval "class OpalAttrAccessorSpec; attr_accessor *%w{foo bar baz}; end"
    OpalAttrAccessorSpec.new.foo.should be_nil
  end

  describe "inside a module" do
    it "defines methods that get donated to a class when included" do
      obj = AttrAccessorSpec::C.new
      obj.foo = 100
      obj.foo.should == 100
    end
  end
end

Version data entries

48 entries across 48 versions & 3 rubygems

Version Path
opal-0.9.0.rc1 spec/opal/core/module/attr_accessor_spec.rb
opal-0.9.0.beta2 spec/opal/core/module/attr_accessor_spec.rb
opal-0.9.0.beta1 spec/opal/core/module/attr_accessor_spec.rb
opal-0.8.1 spec/opal/core/module/attr_accessor_spec.rb
opal-0.8.1.rc1 spec/opal/core/module/attr_accessor_spec.rb
opal-wedge-0.9.0.dev spec/opal/core/module/attr_accessor_spec.rb
opal-0.8.0 spec/opal/core/module/attr_accessor_spec.rb
opal-0.8.0.rc3 spec/opal/core/module/attr_accessor_spec.rb
opal-0.8.0.rc2 spec/opal/core/module/attr_accessor_spec.rb
opal-0.8.0.rc1 spec/opal/core/module/attr_accessor_spec.rb
opal-0.8.0.beta1 spec/opal/core/module/attr_accessor_spec.rb
opal-0.7.2 spec/opal/core/module/attr_accessor_spec.rb
opal-0.7.1 spec/opal/core/module/attr_accessor_spec.rb
opal-0.7.0 spec/opal/core/module/attr_accessor_spec.rb
opal-0.7.0.rc1 spec/opal/core/module/attr_accessor_spec.rb
opal-0.7.0.beta3 spec/opal/core/module/attr_accessor_spec.rb
opal-0.6.3 spec/opal/core/module/attr_accessor_spec.rb
opal-0.7.0.beta2 spec/opal/core/module/attr_accessor_spec.rb
opal-cj-0.7.0.beta2 spec/opal/core/module/attr_accessor_spec.rb
opal-cj-0.7.0.beta1 spec/opal/core/module/attr_accessor_spec.rb