[libweasel-perl] 04/10: * Changes for 0.05 release

Robert James Clay jame at rocasa.us
Tue Aug 15 19:16:10 UTC 2017


This is an automated email from the git hooks/post-receive script.

jame-guest pushed a commit to tag v0.06
in repository libweasel-perl.

commit 75a39d1868ca9b741ac5b2ba9ffae8b9f8cea797
Author: Erik Huelsmann <ehuels at gmail.com>
Date:   Fri Jul 8 12:44:16 2016 +0200

    * Changes for 0.05 release
---
 CHANGES                               |  8 +++++++-
 dist.ini                              |  2 +-
 lib/Weasel.pm                         |  4 ++--
 lib/Weasel/Widgets/HTML/Selectable.pm | 24 ++++++++++++++++++++++--
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/CHANGES b/CHANGES
index 35cb43c..898a72d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,10 @@
-** 0.0. / 2016-07-04\
+
+** 0.05 / 2016-07-08
+   - Change behaviour of Selectable widget (Radiobutton, Checkbox and Option)
+     to return the empty string (false) when not selected for the 'value'
+     attribute
+
+** 0.04 / 2016-07-04
    - Fix timing problem initializing Session's 'page' attribute
      (depends on 'page_class') by making it lazy
 
diff --git a/dist.ini b/dist.ini
index 628fa88..e9b53d2 100644
--- a/dist.ini
+++ b/dist.ini
@@ -1,6 +1,6 @@
 name     = Weasel
 abstract = PHP's Mink inspired multi-protocol web-testing library for Perl
-version  = 0.04
+version  = 0.05
 author   = Erik Huelsmann <ehuels at gmail.com>
 copyright_holder = Erik Huelsmann
 main_module = lib/Pherkin/Extension/Weasel.pm
diff --git a/lib/Weasel.pm b/lib/Weasel.pm
index ee6a1ed..97516b4 100644
--- a/lib/Weasel.pm
+++ b/lib/Weasel.pm
@@ -5,7 +5,7 @@ Weasel - Perl's php/Mink-inspired abstracted web-driver framework
 
 =head1 VERSION
 
-0.04
+0.05
 
 =head1 SYNOPSIS
 
@@ -110,7 +110,7 @@ use warnings;
 
 use Moose;
 
-our $VERSION = '0.04';
+our $VERSION = '0.05';
 
 =head1 ATTRIBUTES
 
diff --git a/lib/Weasel/Widgets/HTML/Selectable.pm b/lib/Weasel/Widgets/HTML/Selectable.pm
index 63ae5d9..0444b86 100644
--- a/lib/Weasel/Widgets/HTML/Selectable.pm
+++ b/lib/Weasel/Widgets/HTML/Selectable.pm
@@ -56,12 +56,32 @@ sets the selected status.
 sub selected {
     my ($self, $value) = @_;
 
-    $self->session->set_selected($self, $value)
+    $self->session->set_attribute($self, 'selected', $value)
         if defined $value;
 
-    return $self->session->get_selected($self);
+    return $self->session->get_attribute($self, 'selected');
 }
 
+=item get_attribute($name)
 
+Returns the value of the attribute; when the element is I<not> selected,
+the 'value' attribute is overruled to return C<false> (an empty string).
+
+=cut
+
+sub get_attribute {
+    my ($self, $name) = @_;
+
+    if ($name eq 'value' && ! $self->selected) {
+        return ''; # false/ not selected
+    }
+    else {
+        return $self->SUPER::get_attribute($name);
+    }
+}
+
+=back
+
+=cut
 
 1;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libweasel-perl.git



More information about the Pkg-perl-cvs-commits mailing list