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.10.6 spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.6.beta spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.5 spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.4 spec/opal/core/module/attr_accessor_spec.rb
opal-0.11.0.rc1 spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.3 spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.2 spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.1 spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.0 spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.0.rc2 spec/opal/core/module/attr_accessor_spec.rb
opal-0.9.4 spec/opal/core/module/attr_accessor_spec.rb
opal-0.9.3 spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.0.rc1 spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.0.beta5 spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.0.beta4 spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.0.beta3 spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.0.beta2 spec/opal/core/module/attr_accessor_spec.rb
opal-0.10.0.beta1 spec/opal/core/module/attr_accessor_spec.rb
opal-0.9.2 spec/opal/core/module/attr_accessor_spec.rb
opal-0.9.0 spec/opal/core/module/attr_accessor_spec.rb